beresp.cacheable

BOOL, can be read and set, but not unset.

Available infetch

Whether or not the object is cacheable. Setting to true will cause otherwise uncacheable responses to be cached. Setting to false will cause otherwise cacheable responses to be passed.

Try it out

beresp.cacheable is used in the following solution recipes, which show real world use cases. Click RUN to provision a Fastly service, execute the code on Fastly, and see how the function behaves.

Cache '429' rate-limiter responses per IP

If a backend returns a 429, cache it for the requesting IP but continue to allow other clients to use origin.

Failover to a secondary backend

If primary backend fails, retry with a different backend without caching the failure or reducing cache efficiency.

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.