I have a django template with a class-based DetailView
associated to it. I've over-ridden the get_context_data
method of the DetailView
, using it to pass some required context
variables that I display in the template (essentially an image). That's all I've done.
How do I ensure this particular django template of mine is never cached by any browser? Wading through various sources tells me I need to over-ride the HttpResponse
in the dispatch
method to accomplish no-cache?
I understand that I'll need to set the Cache-Control
, Pragma
, Expiry
etc. I've just been unable to make headway regarding whether to (or how to) over-ride the dispatch method. Can someone give me a simple clarificational example of how they would go about implementing no-cache for such a template?