I have implemented cache for my articles views, and have set cache page. Currently the issue that i am facing is when i try to POST request data to create new article, the page remains the same.
What i want to do is be able to POST article while i am still in cache page time, and display the new data while being in the cache page time.
following is the cache page code ...
articles views
class ArticleViewSet(viewsets.ModelViewSet):
serializer_class=ArticleSerializer
permission_classes=[permissions.IsAuthenticated]
authentication_classes = [authentication.TokenAuthentication]
@method_decorator(cache_page(300))
@method_decorator(vary_on_headers("Authorization",))
def dispatch(self, *args, **kwargs):
return super(ArticleViewSet, self).dispatch(*args, **kwargs)
Someone can guide how can i achieve this ...