module documentation

Undocumented

Function cache​_control Undocumented
Function cache​_page Decorator for views that tries getting the page from the cache and populates the cache if the page isn't in the cache yet.
Function never​_cache Decorator that adds headers to a response so that it will never be cached.
def cache_control(**kwargs):

Undocumented

def cache_page(timeout, *, cache=None, key_prefix=None):

Decorator for views that tries getting the page from the cache and populates the cache if the page isn't in the cache yet.

The cache is keyed by the URL and some data from the headers. Additionally there is the key prefix that is used to distinguish different cache areas in a multi-site setup. You could use the get_current_site().domain, for example, as that is unique across a Django project.

Additionally, all headers from the response's Vary header will be taken into account on caching -- just like the middleware does.

def never_cache(view_func):
Decorator that adds headers to a response so that it will never be cached.