Skip to main content
HTTP/3xx (Redirection)

304 Not Modified

Indicates that the resource has not been modified since the version specified by the conditional request headers (If-Modified-Since or If-None-Match).

❓ Why does this happen?

Browser or CDN caching optimization to save bandwidth and reduce response latency.

✅ How to fix it

Expected caching behavior. If fresh content is needed, invalidate the cache with Cache-Control: no-cache or update ETags.

Return or handle 304 in your stack

// app/api/resource/route.ts
export function GET() {
  // 304 must not include a response body
  return new Response(null, {
    status: 304
  });
}

Live 304 mock endpoint

Point your app, tests, or retry logic at this free public URL to reproduce a real 304 response (CORS enabled, optional ?delay=ms up to 5000).

https://castov.com/api/mock/304

Frequently Asked Questions

What does HTTP Status 304 mean?
Indicates that the resource has not been modified since the version specified by the conditional request headers (If-Modified-Since or If-None-Match).
Why am I getting a 304 status code?
Browser or CDN caching optimization to save bandwidth and reduce response latency.
How do I fix a 304 Not Modified error?
Expected caching behavior. If fresh content is needed, invalidate the cache with Cache-Control: no-cache or update ETags.
How can I test how my app handles a 304 response?
Send a request to https://castov.com/api/mock/304 — it returns a real 304 Not Modified response with CORS enabled. Add ?delay=2000 to simulate a slow server.

Other 3xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.