req.enable_segmented_caching

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

Available inrecv

Assemble the response from individually cacheable block-aligned file segments.

When you set this variable to true in vcl_recv, you enable a mode referred to as "segmented caching," in which Varnish retrieves and caches files from the origin in segments.

Try it out

req.enable_segmented_caching is used in the following code examples. Examples apply VCL to real-world use cases and can be deployed as they are, or adapted for your own service. See the full list of code examples for more inspiration.

Click RUN on a sample below to provision a Fastly service, execute the code on Fastly, and see how the function behaves.

Enable features gradually

Avoid a huge inrush of traffic to origin caused by gradually applying changes that affect the cache key, like segmented caching, over hours or days.

User contributed notes

BETA

Do you see an error in this page? Do have an interesting use case, example or edge case people should know about? Share your knowledge and help people who are reading this page! (Comments are moderated; for support, please contact support@fastly.com)