
Otherwise,Įxisting headers in Vary aren’t removed. Headers contains an asterisk, then Vary header will consist of a singleĪsterisk '*', according to RFC 9110#section-12.5.5.

Newheaders is a list of header names that should be in Vary. patch_vary_headers( response, newheaders) ¶Īdds (or updates) the Vary header in the given HttpResponse object. add_never_cache_headers( response) ¶Īdds an Expires header to the current date/time.Īdds a Cache-Control: max-age=0, no-cache, no-store, must-revalidate, private header to a response to indicate that a page should never beĮach header is only added if it isn’t already set. patch_response_headers( response, cache_timeout = None) ¶Īdds some useful headers to the given HttpResponse object:Įach header is only added if it isn’t already set.Ĭache_timeout is in seconds. (or None if it wasn’t found or wasn’t an integer).

Returns the max-age from the response Cache-Control header as an integer

Need to distinguish caches by the Accept-language header. Requests with the same path butĭifferent header content for headers named in Vary need to get differentĬache keys to prevent delivery of wrong content.įor example, internationalization middleware would Into account when building its cache key. The header of response objects directly and decorators that change functions toįor information on the Vary header, see RFC 9110#section-12.5.5.Įssentially, the Vary HTTP header defines which headers a cache should take It does soīy managing the Vary header of responses. This module contains helper functions for controlling HTTP caching.
