view help/CPMPolicies.stx @ 0:587011552858

import CMF 1.6.3
author bdelbosc
date Mon, 23 Apr 2007 13:58:01 +0000
line source
1 Cache Policy Manager - Policies
3 A cache policy represent a single class of cachable objects:
5 - class membership is defined by 'predicate', a TALES expression
6 with access to the following top-level names:
8 'object' -- the object itself
10 'view' -- the name of the view method
12 'keywords' -- keywords passed to the request
14 'request' -- the REQUEST object itself
16 'member' -- the authenticated member, or None if anonymous
18 'modules' -- usual TALES access-with-import
20 'nothing' -- None
22 'time' -- A DateTime object for the current date and time
24 - The "Last-modified" HTTP response header will be set using
25 'mtime_func', which is another TALES expression evaluated
26 against the same namespace. If not specified explicitly,
27 uses 'object/modified'.
29 - The "Expires" HTTP response header and the "max-age" token of
30 the "Cache-control" header will be set using 'max_age_secs',
31 if passed; it should be an integer value in seconds.
33 - The "Vary" HTTP response headers will be set if a value is
34 provided. The Vary header is described in RFC 2616. In essence,
35 it instructs caches that respect this header (such as Squid
36 after version 2.4) to distinguish between requests not just by
37 the request URL, but also by values found in the headers showing
38 in the Vary tag. "Vary: Cookie" would force Squid to also take
39 Cookie headers into account when deciding what cached object to
40 choose and serve in response to a request.
42 - The "ETag" HTTP response header will be set if a value is
43 provided. The value is a TALES expression and the result
44 after evaluation will be used as the ETag header value.
46 - Other tokens will be added to the "Cache-control" HTTP response
47 header as follows:
49 'no_cache=1' argument => "no-cache" token
51 'no_store=1' argument => "no-store" token
53 'must_revalidate=1' argument => "must-revalidate" token