Fastly allows you to add a special header to your request which instructs it to include detailed cache information in the response. This information is useful in debugging cache issues, especially around max-age
and surrogate keys.
Firefox's dev tools make it easy to edit and resend an HTTP request. Use this flow to add the Fastly debug header in the browser:
-
Open Dev Tools and switch to the Network tab. You may need to refresh the page to capture the request for the current page.
-
Switch to the "HTML" filter to help you find the request for the current page.
-
Select the request for the current page and click the "Edit and Resend" button.
-
Add a new request header on its own line:
Fastly-Debug: 1
-
Click "Send" to send the edited request. Select the new request from the left panel (it should appear at the bottom).
-
You should now see additional response headers from Fastly.
Chrome doesn't have a built-in UI for editing requests, but allows you to copy the request as a cURL
command. While cumbersome, you can use this approach to add a header to the request, run the command in your terminal, and inspect the response.
Here is an example command, partially redacted to remove the large number of request headers:
curl 'https://qz.com/' \
-H 'accept: text/html;q=0.9' \
-H 'accept-language: en-US,en;q=0.9' \
--compressed
Add two flags to this request: one is the Fastly debug header and the second (-I
) tells cURL
to only print the response headers, which makes the output much easier to inspect:
curl 'https://qz.com/' \
-H 'accept: text/html;q=0.9' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'Fastly-Debug: 1' \
-I \
--compressed
You could also use an extension like ModHeader to add the header.