HTTP 304 Not Modified

The answer to a conditional GET whose If-None-Match matched the current ETag: your cached copy is still valid, so no body is sent.

Defined in RFC 9110 §15.4.5 — 304 Not Modified · MDN reference

Where you meet HTTP 304 in production

Every well-cached asset and API response with a validator. It is the code behind most of the bandwidth a busy site does not spend.

Why you would test it

The cheapest performance win most clients never claim. Test that you store the ETag, send it back, and treat the empty 304 body as a cache hit rather than an error.

What your client should do about a 304

A 304 has no body, and that is the point — serve the cached copy. Send back exactly the validator you were given: the ETag in If-None-Match, or the Last-Modified date in If-Modified-Since. Do not synthesise a validator, and do not strip the quotes or weak-prefix off an ETag.

304 versus the codes it gets confused with

Endpoints that return 304

3 endpoints in this playground answer with 304. Every one is free, needs no signup, and can be called from the browser or with curl.

Questions about HTTP 304

Why is my conditional request always returning 200?
Usually the validator is not being echoed exactly, or the server generates a fresh ETag per response. Compare the ETag you received with the one you sent, byte for byte.
Does a 304 count against a rate limit?
That is the server's choice, but a well-built API charges less for one, because it did less work.

Other redirection codes

All HTTP status codes · All 39 mock REST APIs · Getting started guide

Last updated