Segmented caching

When you set the VCL variable req.enable_segmented_caching 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. Segmented caching was previously known as LFS.

In this mode Varnish will spawn one or more sub-requests, each responsible for a segment of the file. Each segment is cached independently of other segments that constitute the file.

When vcl_log runs in the context of such a sub-request, segmented_caching.is_inner_req evaluates to true. This call to vcl_log allows you to log the outcome of each segment.

After the sequence of sub-requests has completed, vcl_log will run with segmented_caching.is_outer_req evaluating to true. This call to vcl_log allows you to log the final outcome of the request.