Find an HTTP recipe

Choose statuses, bodies, caching, retries, fragments, and origin policy

Define the response first

ProblemRecipe
Choose status, body, and content typeDesign an HTTP response
Keep error bodies predictableUse an error envelope
Return a page or a fragmentNegotiate content explicitly
Swap trusted server markupReplace a region with server HTML

Control requests

ProblemRecipe
Recover from a failed readOffer manual retry
Stop duplicate or stale requestsControl repeated requests
Respect a server limitHandle rate limiting
Move slow work out of the requestRun a background job
Avoid retransferring unchanged dataRevalidate with ETag
Stream a generated file to diskUse a browser download

Handle deployment boundaries

ProblemRecipe
Call JSON servicesUse REST services
Serve a temporary outageReturn maintenance mode
Call another originConfigure cross-origin access