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/304Frequently Asked Questions
What does HTTP Status 304 mean?
Why am I getting a 304 status code?
How do I fix a 304 Not Modified error?
How can I test how my app handles a 304 response?
Other 3xx status codes
Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.