Whereas the cache bypass flow can be triggered by uncacheable requests, the flow is also used when a backend HTTP response is considered uncacheable. The content is delivered to the client through vcl_deliverĪn important difference between vcl_pass and vcl_miss is that for requests that bypass the cache, the backend response is not stored in the cache inside vcl_backend_response.A backend HTTP response is received from the origin server in vcl_backend_response.A backend HTTP request is prepared and executed in vcl_backend_fetch. The rest of the cache bypass flow is similar to the cache miss flow: This is also described in the built-in VCL.Ī cache bypass will send cause a transition to vcl_hash, but from there we will transition to vcl_pass. The cache is also bypassed when the request contains an Authorization header or a Cookie header. If the requests is not GET or HEAD, the cache will be bypassed because we’re detaling with an uncacheable request method. When the request is received and processed in vcl_recv, the built-in VCL performs a number of checks to see whether or not the request can be served from cache. Remember: a cache miss is a hit that hasn’t yet taken place. Not every request results in a hit or a miss. But in vcl_hit the remaining Time To Live is zero or less and a transition is made to vcl_miss because the object is considered stale and in need of revalidation. These objects are initially part of the cache hit flow. The cache miss flow will also be executed for expired objects. When the backend successfully responds, we transition to vcl_backend_response where the backend HTTP response is turned into a cache object and is stored in the cache.Īs soon as the object is stored in the cache, the next request will result in a cache hit.Įventually a transition to vcl_deliver is made where the HTTP response is returned to the client. A backend HTTP request is prepared and executed. When the hash doesn’t yield a result, it means the object is not found in the cache and a backend fetch is needed.īecause of the miss, we obviously end up in vcl_miss.Ī transition is made to vcl_backend_fetch. Just like for any other request, the vcl_recv subroutine is called and just like for cache hits a transition is made to vcl_hash. When a cacheable request is not found in the cache, the cache miss flow is executed. In this scenario no backend connections are made, because the cached object could be delivered to the requesting client. If the object is still fresh, the response is delivered to the client through vcl_deliver. If the hash that is created is found in the cache, we’re dealing with a cache hit. When a request is received that is cacheable, a transition is made from vcl_recv to vcl_hash.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |