config:cache

NAME
config:cache - Enables caching for various protocols and configures general caching parameters.

SYNOPSIS
config:cache [options]

DESCRIPTION
Use the config:cache command to enable caching for HTTP based protocols. Also use this command to configure general caching parameters, including storage, freshness, bypass, and alternates. When you execute the config:cache command, you must use one of the options described below.

OPTIONS
The following options are supported for the config:cache command:

  http <on | off>
Enables (on) or disables (off) the caching of HTTP requests. (The default value is on.)

  ignore-bypass <on | off>
Enables (on) or disables (off) the ignore-bypass option. When enabled (on), the proxy ignores client requests to bypass the cache. (The default value is off.)

  max-object-size <bytes>
Specifies the maximum byte size of documents in the cache. A maximum byte size of zero means that there is no maximum. (The default value is zero.)

  max-alternates <num>
Specifies the maximum number of HTTP alternates that the proxy can cache. (The default value is three.)

  file [url]
Specifies the location (URL) from which the proxy should retrieve and install your cache.config file.

  freshness verify <when-expired | no-date | always | never>
Specifies when to revalidate content. Type when-expired to use cache directives or heuristic. Type no-date to consider the object stale if the object contains no Expires or cache-control headers. (The default value is when-expired.)

  freshness minimum <explicit | last-modified | nothing>
Specifies the type of headers required for the request to be cacheable. Type nothing if you want no required headers to make the document cacheable. Type last-modified if you want at least the last-modified header to be required. Type explicit if you want the Expires or Cache-Control headers required (these explicitly indicate lifetime duration). (The default value is nothing.)

  freshness no-expire-limit greater-than <seconds> less-than <seconds>
Specifies the minimum amount of time in seconds that a document in the cache can be considered fresh. (The default value is 3600.) Specifies the maximum amount of time in seconds that a document in the cache can be considered fresh. (The default value is 86400.)

  dynamic <on | off>
Enables (on) or disables (off) the caching of URLs that look dynamic. (The default value is off.)

  alternates <on | off>
Enables (on) or disables (off) the caching of alternate versions of HTTP objects that do not contain the Vary header. (The default value is off.)

  vary <text | images | other> <field>
Specifies the headers on which the proxy should vary for text, images, and anything other than text and images. (The default value is NULL.)

  cookies <none | all | images | non-text>
Specifies how cookies are cached. Type none to cache no responses to cookies. Type all to cache for any content type. Type images to cache only for image types. Type non-text to cache for all but text content-types. (The default value is non-text.)

EXAMPLES

  Example 1. Enabling the caching of HTTP requests

traffic_shell> config:cache http on
traffic_shell>

  Example 2. Enabling the proxy to ignore client requests to

  bypass the cache

traffic_shell> config:cache ignore-bypass on
traffic_shell>

  Example 3. Specifying no maximum size of documents in the

  cache

traffic_shell> config:cache max-object-size 0
traffic_shell>

  Example 4. Specifying zero as the maximum number of HTTP

  alternates that the proxy can cache

traffic_shell> config:cache max-alternates 0
traffic_shell>

  Example 5. Specifying the location (URL) from which the proxy

  should retrieve and install your cache.config file

traffic_shell> config:cache file http://somedomain.com/path/cache.config
traffic_shell>

  Example 6. Revalidating content by using cache directives

  or heuristic

traffic_shell> config:cache freshness verify when-expired
traffic_shell>

  Example 7. Requiring the Expires or Cache-Control headers

  for cacheability

traffic_shell> config:cache freshness minimum explicit
traffic_shell>

  Example 8. Specifying a minimum and a maximum amount of time

  seconds for a document in the cache to be

  considered fresh

traffic_shell> config:cache freshness no-expire-limit greater-than 900 less-than 7200
traffic_shell>

  Example 9. Enabling the caching of URLs that look dynamic

traffic_shell> config:cache dynamic on
traffic_shell>

  Example 10. Enabling the caching of alternate versions of HTTP

  objects that do not contain the Vary header

traffic_shell> config:cache alternates on
traffic_shell>

  Example 11. Specifying the Cookie header for the proxy to vary on for text

traffic_shell> config:cache vary text Cookie
traffic_shell>

  Example 12. Specifying not to cache responses from cookies

traffic_shell> config:cache cookies none
traffic_shell>

SEE ALSO
show:cache, show:cache-stats