utils.cache.patch_response_headers()

patch_response_headers(response, cache_timeout=None) [source]

Adds some useful headers to the given HttpResponse object:

  • ETag
  • Last-Modified
  • Expires
  • Cache-Control

Each header is only added if it isn’t already set.

cache_timeout is in seconds. The CACHE_MIDDLEWARE_SECONDS setting is used by default.

doc_Django
2016-10-09 18:40:21
Comments
Leave a Comment

Please login to continue.