Cache settings

Configures cache lifetime for objects stored in the Fastly cache, overriding cache freshness information that would otherwise be determined from cache-related headers on the HTTP response. When used in conjunction with conditions, cache settings objects provide detailed control over how long content persists in the cache.

Data model

actionStringIf set, will cause vcl_fetch to terminate after processing this rule with the return state specified. If not set, other configuration logic in vcl_fetch with a lower priority will run after this rule.
passDo not cache the response and do not apply request collapsing to subsquent requests for the period specified in the TTL.
deliverProceed to save the object and deliver the response.
restartDiscard the response and restart VCL processing in vcl_recv.
cache_conditionStringName of a condition object that should be used to test whether to apply the cache settings object.
nameStringName for the cache settings object.
stale_ttlIntegerMaximum time in seconds to continue to use a stale version of the object if future requests to your backend server fail (also known as 'stale if error').
ttlIntegerMaximum time to consider the object fresh in the cache (the cache 'time to live').

Endpoints

List cache settings objects

GET/service/service_id/version/version/cache_settings

Get a cache settings object

GET/service/service_id/version/version/cache_settings/name

Create a cache settings object

POST/service/service_id/version/version/cache_settings

Update a cache settings object

PUT/service/service_id/version/version/cache_settings/old_name

Delete a cache settings object

DELETE/service/service_id/version/version/cache_settings/name

User contributed notes

We welcome comments that add use cases, ideas, tips, and caveats. All comments will be moderated before publication. To post support questions, visit our support center and we'll find you the help you need.