How to make so that the pages given by the python engine, django, are not cached on the client side?

    2 answers 2

    How so? It can not be that it was impossible. This is not a browser setting. When you submit pages, you specify in the HTTP headers expiration date and you can specify the caching mode. Therefore, you must set the date that is known to have passed and select the caching mode, in which there is no caching:

    Cache-Control: no-cache, must-revalidate Pragma: no-cache Expires: Mon, 26 Jul 1997 05:00:00 GMT 

      It is enough to send the appropriate headers to the browser (like, ahead of me, I indicated the correct cy6erGn0m).

      Strange, it seemed to me that Django disables caching by default (of course, if you don’t use the cache framework in your application).

      To explicitly disable caching for this view (this is exactly what is needed if the cache framework is turned on, which caches something by default), you must use the django.views.decorators.cache.never_cache decorator.


      If you do not contact the cache framework, then you can simply set the header Cache-Control: no-cache . This is done like this:

       >>> response = HttpResponse() >>> response['Cache-Control'] = 'no-cache'