Skip to content

Troubleshooting guide

304 Not Modified: what it means

A 304 is a good thing: the browser asked "has this changed?" and the server said "no, use your copy". Problems start only when content changed and the server still answers 304.

3 min read10 sectionsUpdated

On this page

Key points

  • 304 saves bandwidth by skipping the body.
  • It relies on ETag or Last-Modified validators.
  • Stale content means validators did not change with the content.
  • Not an error in monitoring.

What it means

When a cached copy expires, the browser revalidates it with If-None-Match (the ETag) or If-Modified-Since. If the resource is unchanged, the server answers 304 with no body and the browser reuses its copy. It is fast and cheap.

Common causes

  • Normal revalidation (most 304s).
  • ETags that do not change after deploys (generated from inode or a fixed value).
  • CDNs answering 304 from an outdated cached copy.
  • Clocks out of sync breaking Last-Modified.

Fixes if you are visiting the site

  1. If a page looks out of date, force a full reload (Ctrl+Shift+R).

Fixes if it is your site

Make validators change with content: hash-based ETags or file names with content hashes for static assets (app.3f9a1c.js) and long Cache-Control: max-age. Purge the CDN after deploys if it caches HTML.

bash
curl -sI https://example.com/app.js | grep -iE "etag|last-modified|cache-control"
curl -sI https://example.com/app.js -H 'If-None-Match: "abc123"' | head -1

Reading the status code like an engineer

An HTTP status code means the connection worked and a server answered, so the network is fine and the question is which server answered and why. Look at the response headers: Server, Via and CDN-specific headers (cf-ray, x-cache) show whether a CDN, a proxy or your application produced it, and the body format usually confirms it. Then reproduce the exact request with curl, including method, headers and body, and compare it with a request that works. Monitoring should alert on unexpected codes for important URLs, and on rates of 4xx and 5xx rising after a deploy, rather than on every single error.

How site owners catch this before visitors do

Most visitors who hit 304 Not Modified leave without telling you. An uptime check every minute, with a keyword assertion on the page and an SSL check on every run, turns this from a support ticket into an alert. Keep the history: errors that come and go (one region, one server behind a load balancer, one in twenty requests) only make sense on a timeline. Put the result on a status page so people stop guessing. You can test any address now with the free website down checker.

Frequently asked questions

Is 304 an error?

No, it means the cached copy is still valid.

Why do users see old content?

Validators did not change when the content did, or a cache served an old copy.

Should uptime checks accept 304?

Checks normally do not send validators, so they get 200; treat 304 as success if they do.

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.