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.

Try this challenge now

For a guide to how challenges work see getting started.

User contributed notes

BETA

Do you see an error in this page? Do have an interesting use case, example or edge case people should know about? Share your knowledge and help people who are reading this page! (Comments are moderated; for support, please contact support@fastly.com)