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 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.

Enable segmented caching gradually

Avoid a huge inrush of traffic to origin caused by enabling segmented caching, by enabling it gradually over a period of hours or days.

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.