.\" Man page generated from reStructuredText. . .TH "CACHE.CONFIG" "5" "Mar 08, 2019" "7.1" "Apache Traffic Server" .SH NAME cache.config \- the cache.config file defines how Traffic Server caches web objects. You can add caching rules to specify the following: . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .INDENT 0.0 .IP \(bu 2 Not to cache objects from specific IP addresses. .IP \(bu 2 How long to pin particular objects in the cache. .IP \(bu 2 How long to consider cached objects as fresh. .IP \(bu 2 Whether to ignore no\-cache directives from the server. .UNINDENT .sp \fBIMPORTANT:\fP .INDENT 0.0 .INDENT 3.5 After modifying \fI\%cache.config\fP, run \fBtraffic_ctl config reload\fP to apply changes. When you apply the changes to one node in a cluster, Traffic Server automatically applies the changes to all other nodes in the cluster. .UNINDENT .UNINDENT .SH FORMAT .sp Each line in the \fI\%cache.config\fP file contains a caching rule. Traffic Server recognizes three space\-delimited tags: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C primary_destination=value secondary_specifier=value action=value .ft P .fi .UNINDENT .UNINDENT .sp You can use more than one secondary specifier in a rule. However, you cannot repeat a secondary specifier. The following list shows the possible primary destinations with allowed values. .SS Primary Destinations .sp The primary destination field on each line is used to restrict the requests to which the caching rule will apply. .INDENT 0.0 .TP .B \fBdest_domain\fP A requested domain name. Traffic Server matches the host name of the destination from the URL in the request. .UNINDENT .INDENT 0.0 .TP .B \fBdest_host\fP Alias for \fBdest_domain\fP\&. .UNINDENT .INDENT 0.0 .TP .B \fBdest_ip\fP A requested IP address. Traffic Server matches the IP address of the destination in the request. .UNINDENT .INDENT 0.0 .TP .B \fBhost_regex\fP A regular expression to be tested against the destination host name in the request. .UNINDENT .INDENT 0.0 .TP .B \fBurl_regex\fP A regular expression to be tested against the URL in the request. .UNINDENT .SS Secondary Specifiers .sp The secondary specifiers are optional and may be used to further restrict which requests are impacted by the caching rule. Multiple secondary specifiers may be used within a single rule, though each type of specifier can appear at most one time. In other words, you may have both a \fBport\fP and \fBscheme\fP in the same rule, but you may not have two \fBport\fPs. .INDENT 0.0 .TP .B \fBport\fP Request URL port. .UNINDENT .INDENT 0.0 .TP .B \fBscheme\fP Request URL protocol (http or https). .UNINDENT .INDENT 0.0 .TP .B \fBprefix\fP Prefix in the path part of a URL. .UNINDENT .INDENT 0.0 .TP .B \fBsuffix\fP File suffix in the URL. .UNINDENT .INDENT 0.0 .TP .B \fBmethod\fP Request URL method (get, put, post, trace, etc.). .UNINDENT .INDENT 0.0 .TP .B \fBtime\fP A time range, such as 08:00\-14:00. Specified using a 24\-hour clock in the timezone of the Traffic Server server. .UNINDENT .INDENT 0.0 .TP .B \fBsrc_ip\fP Client IP address. .UNINDENT .INDENT 0.0 .TP .B \fBinternal\fP A boolean value, \fBtrue\fP or \fBfalse\fP, specifying if the rule should match (or not match) a transaction originating from an internal API. This is useful to differentiate transactions originating from a Traffic Server plugin. .UNINDENT .SS Actions .sp The final component of a caching rule is the action, which determines what Traffic Server will do with all objects matching the primary destinations and secondary specifiers of the rule in question. .INDENT 0.0 .TP .B \fBaction\fP One of the following values: .TS center; |l|l|. _ T{ Value T} T{ Effect T} _ T{ \fBnever\-cache\fP T} T{ Never cache specified objects. T} _ T{ \fBignore\-no\-cache\fP T} T{ Ignore all \fBCache\-Control: no\-cache\fP headers. T} _ T{ \fBignore\-client\-no\-cache\fP T} T{ Ignore \fBCache\-Control: no\-cache\fP headers from client requests. T} _ T{ \fBignore\-server\-no\-cache\fP T} T{ Ignore \fBCache\-Control: no\-cache\fP headers from origin server responses. T} _ T{ \fBcluster\-cache\-local\fP T} T{ Allow for this content to be stored locally on every cluster node. T} _ .TE .UNINDENT .INDENT 0.0 .TP .B \fBcache\-responses\-to\-cookies\fP Change the style of caching with regard to cookies. This effectively overrides the configuration parameter \fBproxy.config.http.cache.cache_responses_to_cookies\fP and uses the same values with the same semantics. The override happens only for requests that match. .UNINDENT .INDENT 0.0 .TP .B \fBpin\-in\-cache\fP Preserves objects in cache, preventing them from being overwritten. Does not affect objects that are determined not to be cacheable. This setting can have performance issues, and severely affect the cache. For instance, if the primary destination matches all objects, once the cache is full, no new objects could get written as nothing would be evicted. Similarly, for each cache\-miss, each object would incur extra checks to determine if the object it would replace could be overwritten. .sp The value is the amount of time you want to keep the object(s) in the cache. The following time formats are allowed: .INDENT 7.0 .IP \(bu 2 \fBd\fP for days; for example: 2d .IP \(bu 2 \fBh\fP for hours; for example: 10h .IP \(bu 2 \fBm\fP for minutes; for example: 5m .IP \(bu 2 \fBs\fP for seconds; for example: 20s .IP \(bu 2 mixed units; for example: 1h15m20s .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fBrevalidate\fP For objects that are in cache, overrides the the amount of time the object(s) are to be considered fresh. Use the same time formats as \fBpin\-in\-cache\fP\&. .UNINDENT .INDENT 0.0 .TP .B \fBttl\-in\-cache\fP Forces object(s) to become cached, as if they had a \fBCache\-Control: max\-age: