| .\" Licensed to the Apache Software Foundation (ASF) under one .\" |
| .\" or more contributor license agreements. See the NOTICE file .\" |
| .\" distributed with this work for additional information .\" |
| .\" regarding copyright ownership. The ASF licenses this file .\" |
| .\" to you under the Apache License, Version 2.0 (the .\" |
| .\" "License"); you may not use this file except in compliance .\" |
| .\" with the License. You may obtain a copy of the License at .\" |
| .\" .\" |
| .\" http://www.apache.org/licenses/LICENSE-2.0 .\" |
| .\" .\" |
| .\" Unless required by applicable law or agreed to in writing, software .\" |
| .\" distributed under the License is distributed on an "AS IS" BASIS, .\" |
| .\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. .\" |
| .\" See the License for the specific language governing permissions and .\" |
| .\" limitations under the License. .\" |
| .TH "config:cache" |
| .SH NAME |
| config:cache \- Enables caching for various protocols and configures general |
| caching parameters. |
| .SH SYNOPSIS |
| config:cache [options] |
| .SH 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. |
| .SH OPTIONS |
| The following options are supported for the config:cache command: |
| .SS "http <on | off>" |
| Enables (on) or disables (off) the caching of HTTP requests. (The default value |
| is on.) |
| .SS "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.) |
| .SS "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.) |
| .SS "max-alternates <num>" |
| Specifies the maximum number of HTTP alternates that the proxy can cache. (The |
| default value is three.) |
| .SS "file [url]" |
| Specifies the location (URL) from which the proxy should retrieve and install |
| your cache.config file. |
| .SS "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.) |
| .SS "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.) |
| .SS "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.) |
| .SS "dynamic <on | off>" |
| Enables (on) or disables (off) the caching of URLs that look dynamic. (The |
| default value is off.) |
| .SS "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.) |
| .SS "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.) |
| .SS "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.) |
| .SH EXAMPLES |
| .SS "Example 1. Enabling the caching of HTTP requests" |
| .PP |
| .nf |
| traffic_shell> config:cache http on |
| traffic_shell> |
| .SS "Example 2. Enabling the proxy to ignore client requests to" |
| .SS " bypass the cache" |
| .PP |
| .nf |
| traffic_shell> config:cache ignore-bypass on |
| traffic_shell> |
| .SS "Example 3. Specifying no maximum size of documents in the" |
| .SS " cache" |
| .PP |
| .nf |
| traffic_shell> config:cache max-object-size 0 |
| traffic_shell> |
| .SS "Example 4. Specifying zero as the maximum number of HTTP" |
| .SS " alternates that the proxy can cache" |
| .PP |
| .nf |
| traffic_shell> config:cache max-alternates 0 |
| traffic_shell> |
| .SS "Example 5. Specifying the location (URL) from which the proxy" |
| .SS " should retrieve and install your cache.config file" |
| .PP |
| .nf |
| traffic_shell> config:cache file http://somedomain.com/path/cache.config |
| traffic_shell> |
| .SS "Example 6. Revalidating content by using cache directives" |
| .SS " or heuristic" |
| .PP |
| .nf |
| traffic_shell> config:cache freshness verify when-expired |
| traffic_shell> |
| .SS "Example 7. Requiring the Expires or Cache-Control headers " |
| .SS " for cacheability" |
| .PP |
| .nf |
| traffic_shell> config:cache freshness minimum explicit |
| traffic_shell> |
| .SS "Example 8. Specifying a minimum and a maximum amount of time" |
| .SS " seconds for a document in the cache to be " |
| .SS " considered fresh" |
| .PP |
| .nf |
| traffic_shell> config:cache freshness no-expire-limit greater-than 900 less-than 7200 |
| traffic_shell> |
| .SS "Example 9. Enabling the caching of URLs that look dynamic" |
| .PP |
| .nf |
| traffic_shell> config:cache dynamic on |
| traffic_shell> |
| .SS "Example 10. Enabling the caching of alternate versions of HTTP |
| .SS " objects that do not contain the Vary header" |
| .PP |
| .nf |
| traffic_shell> config:cache alternates on |
| traffic_shell> |
| .SS "Example 11. Specifying the Cookie header for the proxy to vary on for text" |
| .PP |
| .nf |
| traffic_shell> config:cache vary text Cookie |
| traffic_shell> |
| .SS "Example 12. Specifying not to cache responses from cookies" |
| .PP |
| .nf |
| traffic_shell> config:cache cookies none |
| traffic_shell> |
| .SH "SEE ALSO" |
| show:cache, show:cache-stats |