| Version: v2023-01-05 | 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_STORE 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_v2023_01_05 {
    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  0is the same as setting ano-cacheheader, which forces content to revalidate. | 
| default_ttl | The maximum time content may remain cached. Setting the value to  0is the same as setting ano-cacheheader, which forces content to revalidate. | 
| enhanced_rfc_support | This enables honoring particular  Cache-Controlheader directives from the origin. Supports all official RFC 7234 directives except forno-transform. | 
| honor_no_store | Instructs edge servers not to cache the response when the origin response includes the  no-storedirective. | 
| honor_private | Instructs edge servers not to cache the response when the origin response includes the  privatedirective. | 
| honor_no_cache | With the  no-cachedirective present in the response, this instructs edge servers to validate or refetch the response for each request. Effectively, set the time to livettlto zero seconds. | 
| honor_max_age | This instructs edge servers to cache the object for a length of time set by the  max-agedirective in the response. When present in the origin response, this directive takes precedence over themax-agedirective and thedefault_ttlsetting. | 
| honor_s_maxage | Instructs edge servers to cache the object for a length of time set by the  s-maxagedirective in the response. When present in the origin response, this directive takes precedence over themax-agedirective and thedefault_ttlsetting. | 
| 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-revalidatedirective 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. | 
