If a request is a cache miss but the origin returns an uncacheable response, then the response will be used to serve only the first request, and queued requests will form a new queue behind the next request in the queue (see WARNING below). Vcl_recv: lookup ➔ vcl_miss: fetch ➔ vcl_fetch: deliver ➔ * On a normal cache miss, where the origin serves a cacheable response, requests will collapse and all overlapping requests will get copies of the same response when it's received from origin. These scenarios are laid out below (non-default behaviors in bold): In this situation, requests that have joined the waiting list are dequeued and processed separately, and future requests arriving during the TTL of the hit-for-pass object. In VCL services, a hit-for-pass object is created and inserted into cache if return(pass) is found in vcl_fetch, for a cacheable response. For high traffic services, correct use of request collapsing will substantially reduce and smooth out traffic to origin servers.īy default, cache misses will qualify for request collapsing in both VCL and services. This prevents the expiry of a very highly demanded object in the cache causing an immediate flood of requests to an origin server, which might otherwise overwhelm it or consume expensive resources.
Request collapsing is the practice of combining multiple requests for the same object into a single request to origin, and then potentially using the resulting response to satisfy all pending requests.