HTTP cache management — CubicWeb 3.13.2

### Navigation

- index
- modules |
- next |
- previous |
- CubicWeb 3.13.2 »
- Web side development »

# HTTP cache management

HTTP cache managers

## Cache policies

class `cubicweb.web.httpcache.` `NoHTTPCacheManager`(view)
  default cache manager: set no-cache cache control policy

class `cubicweb.web.httpcache.` `MaxAgeHTTPCacheManager`(view)
  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)

  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)

  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`
  an etag can’t be generated

## Helper functions

`cubicweb.web.httpcache.` `set_http_cache_headers`(self)

### Navigation

- index
- modules |
- next |
- previous |
- CubicWeb 3.13.2 »
- Web side development »