Here’s a general overview of where in your VCL you can see your Fastly settings applied:
vcl_recv receives the request:
- Default Host is set.
- Backends are set. This also where rules for routing requests to specific backends are applied.
- Shielding is set, if enabled.
- Request Setting are set to allow you to force an action - such as look-up or pass - on a request.
- Request Headers are applied to the request object.
- Request Conditions capture url requests for special settings and routes to vcl_error - for example, HTTP Redirects, Custom (synthetic) Responses, URL rewrite/redirect.
vcl_error handles errors and custom redirects or responses:
- Force SSL request settings, HTTP redirects at the edge, and Custom (synthetic) responses are routed here from vcl_recv. May make changes to the object’s status code, response, location, content-type, and/or content. Then routes the object to vcl_deliver.
vcl_fetch runs after fetching the object from your origin. Settings applied here will affect how the object is cached:
- Default TTL is applied to the object.
- Cache-Settings that set cache rules based on backend responses or set Force PASS on an object.
- Cache Headers are set to store information on the cached object.
- Stale-while-revalidate and Stale-with-Error rules are applied.
- Automatic GZIPing rules are applied.
vcl_deliver executes right before the response object is delivered to the client:
Please sign in to leave a comment.