HTTP 304 Not Modified — What It Means and How to Fix It

The HTTP 304 (Not Modified) status code indicates that the client's cached copy of a resource is still fresh and can be used. The server is telling the client that the resource has not changed since the last time it was requested, thus saving bandwidth and server processing.

Last updated: 2026-06-11

RECOMMENDED

Essential Reading: Designing Data-Intensive Applications

The system design bible for software engineers. Learn to build reliable, scalable, and maintainable systems.

View on Amazon →
Status Code 304
Name Not Modified

Common Causes

  • Client sends conditional request headers (e.g., If-Modified-Since, If-None-Match) that match the server's current resource state.
  • The resource on the server has not been updated since the timestamp or ETag provided by the client.
  • Efficient caching mechanisms are in place on both the client and server sides.

Code Examples to Handle HTTP 304

curl -I https://httpbin.org/status/304

How to Fix It

  1. Verify that your server is correctly setting `Last-Modified` and/or `ETag` headers for cacheable resources.
  2. Ensure your client-side caching logic (e.g., browser, CDN) is sending appropriate conditional request headers.
  3. Inspect network requests in developer tools to confirm that `If-Modified-Since` or `If-None-Match` headers are being sent and that the server is responding with 304 when appropriate.
💡 Example: A user visits a website. Their browser has a cached copy of the site's CSS file from a previous visit. When the browser requests the CSS file again, it sends an `If-Modified-Since` header with the date it last downloaded the file. If the server determines the CSS file hasn't changed since that date, it responds with a 304 Not Modified, and the browser uses its cached version.
🛠️ Developer Tip: A 304 response is generally a good sign, indicating efficient caching. Focus on ensuring your server provides accurate cache validation headers and that clients utilize them correctly.

Related Status Codes

Frequently Asked Questions

What causes HTTP 304?

HTTP 304 is caused when a client sends a conditional request (using headers like `If-Modified-Since` or `If-None-Match`) for a resource, and the server determines that the resource has not been modified since the client's last request or since the ETag provided.

How do I fix HTTP 304?

You don't 'fix' HTTP 304 in the traditional sense, as it's an intended and beneficial response. Instead, you ensure your server correctly provides cache validation headers (`Last-Modified`, `ETag`) and that clients are sending conditional requests to leverage caching effectively. If you're unexpectedly getting a 304 when you expect new content, it means your server's cache validation headers are out of sync with the actual resource state, or your client isn't bypassing the cache when it should.