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.
- segmented_caching.autopurged — Whether an inconsistency encountered during segmented caching led to the system automatically enqueuing a purge request
- segmented_caching.block_number — A zero-based counter identifying the file segment being processed
- segmented_caching.block_size — The number of bytes constituting each block-aligned file segment
- segmented_caching.cancelled — Whether segmented caching was enabled and cancelled by a non-206 response
- segmented_caching.client_req.is_open_ended — Whether the client's request leaves the upper bound of the range open
- segmented_caching.client_req.is_range — Whether the client's request is a range request
- segmented_caching.client_req.range_high — The upper bound of the client's requested range
- segmented_caching.client_req.range_low — The lower bound of the client's requested range
- segmented_caching.completed — Whether segmented caching was enabled and completed successfully
- segmented_caching.error — A string describing the reason why segmented caching failed
- segmented_caching.failed — Whether segmented caching was enabled and ended in a failure
- segmented_caching.is_inner_req — Whether VCL is running in the context of a subrequest that is retrieving a segment of a file
- segmented_caching.is_outer_req — Whether VCL is running in the context of a request that is assembling file segments into a response
- segmented_caching.obj.complete_length — The size of the whole file in bytes
- segmented_caching.rounded_req.range_high — The upper bound of the rounded block being processed
- segmented_caching.rounded_req.range_low — The lower bound of the rounded block being processed
- segmented_caching.total_blocks — The number of segments needed for assembling this response