Skip to content
2xx · successSent by App | CDN

200OK

The request worked, and the response carries the result.

How you get a 200 without the app

The CDN already holds a copy of this page. It answers by itself and the CDN sends 200. The request never reaches the proxy, the app or the database.

Who sends itApp · CDN

  1. Browser
  2. CDN
  3. Proxy
  4. App
  5. DB

Typically the application. A CDN or proxy also sends 200 on its own when it answers from its cache, and then the app never sees the request.

In short

What a 200 OK means

A 200 OK says the server handled the request and the response holds the result: the page for a GET, the outcome of the action for a POST. It is the code every other code is measured against, and it tells you less than it seems to. It does not say which box answered. A CDN that has the page in its cache replies 200 without contacting the application, so the response may be minutes or hours old. It also does not say the operation succeeded in business terms. Plenty of APIs reply 200 and put the failure inside the body, which leaves dashboards that count status codes blind. When a 200 looks wrong, check the Age and cache headers to see who answered, then read the body.

When you see a 200

  1. 1The app handled the request and returned the result.

    How to check: Look at the status line and the body together.

    curl -si https://example.com/api/items | head -20
  2. 2A cache answered instead of the app, so the content may be old.

    How to check: An Age header, or a cache status of HIT, means the app was not asked.

    curl -sI https://example.com/ | grep -iE 'age|x-cache|cf-cache-status'
  3. 3The API reports failures inside a 200 body.

    How to check: Read the body for an error field. Alert on that field, not only on the status code.

    {"ok": false, "error": "card_declined"}

Retry or not?

Nothing to retry

The request was handled, so there is nothing to retry. If the body reports a failure, treat it as that failure and ignore the 200.

Headers that matter

Content-Type
Says how to read the body. A JSON API answering with text/html usually means a login or error page slipped in.
Age
Seconds the response has spent in a cache. Present means a cache answered.
Cache-Control / ETag
Decide how long caches may reuse this response and how they check it is still current.

In the real world

RFC vs real deployments

RFC 9110 defines what a 200 carries per method: the resource for GET, the result of the action for POST. It assumes that failures use other codes. Many real APIs do not: GraphQL servers and some RPC-style APIs answer 200 for nearly everything and describe errors in the body. Web pages do the same with “soft 404s”, a not-found page served with 200.

Seen in a real outage

A green health check is just a 200 from one endpoint. At Val Town, a fixed group of customers had requests hang for seven hours while the health check kept passing.

Your turn

Which code is it?

Your dashboard shows 100% of checkout requests returning 200, yet users report “payment failed” messages. What is the most likely explanation?

200 questions

Does 200 OK mean my request succeeded?
It means the server handled it and sent a result. For most APIs that is success, but some report failures inside the body of a 200, so check the body too.
Who sends a 200?
Typically the application. A CDN or caching proxy sends 200 by itself when it answers from its cache; the Age header tells you when that happened.
What is the difference between 200 and 204?
Both mean success. A 200 has a body with the result. A 204 has no body at all and tells the client there is nothing to show.

Sources: RFC 9110: 200 OK (section 15.3.1) ↗ · RFC 9111: HTTP Caching, Age header (section 5.1) ↗ · Report a problem

Diagrams are our own simulations. All wording is original and paraphrases the linked sources.

Practise this in the DNS / HTTP track

Two-minute animated lessons, then boss fights from real outages. Free, no account needed.

Start the track