Find an HTTP recipe
Choose statuses, bodies, caching, retries, fragments, and origin policy
Define the response first
| Problem | Recipe |
|---|---|
| Choose status, body, and content type | Design an HTTP response |
| Keep error bodies predictable | Use an error envelope |
| Return a page or a fragment | Negotiate content explicitly |
| Swap trusted server markup | Replace a region with server HTML |
Control requests
| Problem | Recipe |
|---|---|
| Recover from a failed read | Offer manual retry |
| Stop duplicate or stale requests | Control repeated requests |
| Respect a server limit | Handle rate limiting |
| Move slow work out of the request | Run a background job |
| Avoid retransferring unchanged data | Revalidate with ETag |
| Stream a generated file to disk | Use a browser download |
Handle deployment boundaries
| Problem | Recipe |
|---|---|
| Call JSON services | Use REST services |
| Serve a temporary outage | Return maintenance mode |
| Call another origin | Configure cross-origin access |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.