Retaining a HEAD request
Difficulty level: Medium
Objective
In this challenge, a Fastly service is receiving a HEAD
request followed by a GET
request, for the same URL. By default in VCL services, Fastly transforms HEAD
requests into GET
requests, so that the entire object being requested is loaded into our edge cache. However, you may want HEAD
requests from clients to be passed to origin as HEAD
.
If the backend receives a HEAD
request, it won't include the body in the response, so it's also important to ensure that subsequent GET
requests do receive the body content that they expect.