HTTP cache management#

HTTP cache managers

Cache policies#

class cubicweb.web.httpcache.NoHTTPCacheManager(view)[source]#

default cache manager: set no-cache cache control policy

class cubicweb.web.httpcache.MaxAgeHTTPCacheManager(view)[source]#

max-age cache manager: set max-age cache control policy, with max-age specified with the cache_max_age attribute of the view

class cubicweb.web.httpcache.EtagHTTPCacheManager(view)[source]#

etag based cache manager for startup views

  • etag is generated using the view name and the user’s groups

  • set policy to ‘must-revalidate’ and expires to the current time to force revalidation on each request

class cubicweb.web.httpcache.EntityHTTPCacheManager(view)[source]#

etag based cache manager for view displaying a single entity

  • etag is generated using entity’s eid, the view name and the user’s groups

  • get last modified time from the entity definition (this may not be the entity’s modification time since a view may include some related entities with a modification time to consider) using the last_modified method

Exception#

exception cubicweb.web.httpcache.NoEtag[source]#

an etag can’t be generated

Helper functions#

cubicweb.web.httpcache.set_http_cache_headers(self)[source]#