HTTP status codes are three-digit responses sent by servers to describe the outcome of a request. They’re grouped into five classes:
Class | Range | Meaning |
---|---|---|
1xx | 100–199 | Informational — request received |
2xx | 200–299 | Success — request handled |
3xx | 300–399 | Redirection — further action needed |
4xx | 400–499 | Client error — problem with request |
5xx | 500–599 | Server error — problem on the server |
Quick Reference: Common Codes
2xx — Success
3xx — Redirection
4xx — Client Error
5xx — Server Error
How Status Codes Affect CDNs
- Cacheability: Many 2xx and 3xx responses are cacheable if
Cache-Control
orExpires
allow it. 304 saves bandwidth using validators. Short TTLs for some 4xx reduce repeated bad requests. 5xx are usually not cached, but some CDNs can servestale-if-error
. - Failover: 5xx/504 often trigger retries or failover. Health checks should treat 3xx with care.
- 206 Partial Content: Essential for media delivery; CDNs must handle
Content-Range
correctly.
Best Practices & Further Reading
If you’re implementing servers, APIs, or CDN configurations (deciding which status code to return and how to cache it), these focused guides go deeper:
Choosing the Right HTTP Status Code — Covers when to use 200 vs 201 vs 202; 204 vs 304; mapping validation/auth/quota issues to 400/401/403/429; idempotency, retries, and how status codes interact with
Cache-Control
and conditional requests.Redirects Deep Dive: 301 vs 302 vs 307 vs 308 — Explains method preservation (POST vs GET), SEO and caching semantics, CDN TTLs for redirects, migration playbooks, and pitfalls when changing temporary to permanent.