MCPcopy
hub / github.com/django/django / add_never_cache_headers

Function add_never_cache_headers

django/utils/cache.py:290–297  ·  view source on GitHub ↗

Add headers to a response to indicate that a page should never be cached.

(response)

Source from the content-addressed store, hash-verified

288
289
290def add_never_cache_headers(response):
291 """
292 Add headers to a response to indicate that a page should never be cached.
293 """
294 patch_response_headers(response, cache_timeout=-1)
295 patch_cache_control(
296 response, no_cache=True, no_store=True, must_revalidate=True, private=True
297 )
298
299
300def patch_vary_headers(response, newheaders):

Callers 1

_view_wrapperFunction · 0.90

Calls 2

patch_response_headersFunction · 0.85
patch_cache_controlFunction · 0.85

Tested by

no test coverage detected