I have a Django REST API, and I am using Redis as the caching backend.
Code
@method_decorator(cache_page(60*60))
def dispatch(self, *args, **kwargs):
return super().dispatch(*args, **kwargs)
It caches the data on a get call, but when I insert a new record, that new record is not showing up in the list (Which is coming from cache).
For eg: if there are 4 records in DB, they are being cached properly, but when I insert a new record, its not showing the get call.