Fighting client-side caching in Django -
i'm using render_to_response shortcut , don't want craft specific response object add additional headers prevent client-side caching.
i'd have response contains:
- pragma: no-cache
- cache-control : no-cache
- cache-control: must-revalidate
and other nifty ways browsers interpret directives avoid caching.
is there no-cache middleware or similar can trick minimal code intrusion?
you can achieve using cache_control decorator. example documentation:
from django.views.decorators.cache import never_cache @never_cache def myview(request): # ...
Comments
Post a Comment