I have a method in view which loads the statistics page.
Here I need to control caching of ‘@csrf_protect’ from the view.
My code snippet looks like –
def statistics(request, id):
test = Test.objects.get(id=id)
result = statistics.objects.get(test=test, user=request.user)
context ={ 'test' : test, 'result' : result, 'review' : True }
return render_to_response('statistics.html', context, context_instance = RequestContext(request))
How can I do that?
You can use the @cache_page is a method decorator.