Synthetic error response

Difficulty level: Difficult

Objective

The backend provided in this challenge returns a 503 (service unavailable) error response that includes a unique error code in an HTTP response header called error-code. Your goal is to serve a pleasant-looking synthetic HTML response from the edge, but include the error code from the original 503 response in the body of the synthetic response.

This requires proper handling of the original non-cacheable 503 response, but it also requires pulling out the value of the error-code header, and including it into the synthetic response being delivered back to clients.

The challenge includes two identical requests. The second should produce the same outcome but not require the fetch to the backend.

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)