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
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.
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.
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.
16 endpoints in this playground answer with 304. Every one is free, needs no signup, and can be called from the browser or with curl.
GET https://funapi.dev/api/football/v1/standings — League table — cacheable (ETag / If-None-Match / 304) (Football API) Open & run this endpointGET https://funapi.dev/api/bank/v1/exchange-rates — Exchange rates (cacheable, ETag + If-None-Match → 304) (Bank API) Open & run this endpointGET https://funapi.dev/api/fiba/v1/groups/{letter}/standings — Group table computed from finished games — cacheable (ETag / If-None-Match / 304) (FIBA World Cup API) Open & run this endpointGET https://funapi.dev/api/faults/v1/status/{code} — Return any status code on demand (200–599) (Fault Injection API) Open & run this endpointGET https://funapi.dev/api/classic/v1/users/{id} — Get one user (ETag; If-None-Match → 304) (Classic Fake REST API) Open & run this endpointGET https://funapi.dev/api/classic/v1/posts/{id} — Get one post (ETag; If-None-Match → 304) (Classic Fake REST API) Open & run this endpointGET https://funapi.dev/api/classic/v1/comments/{id} — Get one comment (ETag; If-None-Match → 304) (Classic Fake REST API) Open & run this endpointGET https://funapi.dev/api/classic/v1/todos/{id} — Get one todo (ETag; If-None-Match → 304) (Classic Fake REST API) Open & run this endpointGET https://funapi.dev/api/classic/v1/products/{id} — Get one product (ETag; If-None-Match → 304) (Classic Fake REST API) Open & run this endpointGET https://funapi.dev/api/classic/v1/carts/{id} — Get one cart (ETag; If-None-Match → 304) (Classic Fake REST API) Open & run this endpointGET https://funapi.dev/api/echo/v1/etag/{etag} — Responds with your ETag; If-None-Match → 304, mismatched If-Match → 412 (HTTP Echo & Inspect API) Open & run this endpointGET https://funapi.dev/api/football-league/v1/games/{id} — One game — ETag changes when the score does; poll with If-None-Match for 304 (Pro Football League API) Open & run this endpointGET https://funapi.dev/api/basketball-league/v1/games/{id} — One game — ETag changes when the score does; poll with If-None-Match for 304 (Pro Basketball API) Open & run this endpointGET https://funapi.dev/api/baseball/v1/games/{id} — One game — ETag changes when the score does; poll with If-None-Match for 304 (Baseball Stats API) Open & run this endpointGET https://funapi.dev/api/fhir/r4/Patient/{id} — Read a patient (ETag W/"versionId"); deleted → 410 (FHIR R4 Health Records API) Open & run this endpointGET https://funapi.dev/api/delivery/v1/orders/{id} — Order status — ETag changes on every transition; poll with If-None-Match (Food Delivery API) Open & run this endpointAll HTTP status codes · All 55 mock REST APIs · Getting started guide
Last updated