caching
Version: v2024-04-29 | Includes use: Yes |
---|
Behavior name: Caching
Control content caching on edge servers: whether or not to cache, whether to honor the origin's caching headers, and for how long to cache. Note that any NO
or BYPASS
CACHE
HTTP headers set on the origin's content override this behavior. For more details on how caching works in Property Manager, see the Learn about caching section in the guide.
Default behavior
These samples reflect the behavior's default settings. You can use these as is in your configurations or make adjustments based on the behavior's available options.
data "akamai_property_rules_builder" "caching" {
rules_v2025_02_18 {
name = "Caching"
comments = "Controls content caching on edge servers."
behavior {
caching {
behavior = "MAX_AGE"
must_revalidate = false
ttl = ""
}
}
}
}
"behaviors": [
{
"name": "caching",
"options": {
"behavior": "MAX_AGE",
"mustRevalidate": false,
"ttl": ""
}
}
]
Options
Option | Description |
---|---|
behavior |
Specify the caching option. Value is one of:
|
must_revalidate |
Determines what to do once the cached content has expired, by which time the Akamai platform should have re-fetched and validated content from the origin. If enabled, only allows the re-fetched content to be served. If disabled, may serve stale content if the origin is unavailable.
|
ttl |
The maximum time content may remain cached. Setting the value to
0 is the same as setting a no-cache header, which forces content to revalidate.
|
default_ttl |
The maximum time content may remain cached. Setting the value to
0 is the same as setting a no-cache header, which forces content to revalidate.
|
enhanced_rfc_support |
This enables honoring particular
Cache-Control header directives from the origin. Supports all official RFC 7234 directives except for no-transform .
|
honor_no_store |
Instructs edge servers not to cache the response when the origin response includes the
no-store directive.
|
honor_private |
Instructs edge servers not to cache the response when the origin response includes the
private directive.
|
honor_no_cache |
With the
no-cache directive present in the response, this instructs edge servers to validate or refetch the response for each request. Effectively, set the time to live ttl to zero seconds.
|
honor_max_age |
This instructs edge servers to cache the object for a length of time set by the
max-age directive in the response. When present in the origin response, this directive takes precedence over the max-age directive and the default_ttl setting.
|
honor_s_maxage |
Instructs edge servers to cache the object for a length of time set by the
s-maxage directive in the response. When present in the origin response, this directive takes precedence over the max-age directive and the default_ttl setting.
|
honor_must_revalidate |
This instructs edge servers to successfully revalidate with the origin server before using stale objects in the cache to satisfy new requests.
|
honor_proxy_revalidate |
With the
proxy-revalidate directive present in the response, this instructs edge servers to successfully revalidate with the origin server before using stale objects in the cache to satisfy new requests.
|
Updated about 19 hours ago