HTTP 304 Not Modified vs 524 A Timeout Occurred
HTTP 304 (Not Modified) is a 3xx Redirection response, while 524 (A Timeout Occurred) is a 5xx Server Error response. 304 indicates that the resource has not been modified since the last request. The client can use its cached copy. In contrast, 524 means that cloudflare-specific. A TCP connection was established but the origin didn't respond with an HTTP response in time.
Description
The resource has not been modified since the last request. The client can use its cached copy.
When You See It
When the browser cache is still valid (If-None-Match / If-Modified-Since headers match).
How to Fix
No fix needed. This saves bandwidth by confirming the cached version is still current.
Description
Cloudflare-specific. A TCP connection was established but the origin didn't respond with an HTTP response in time.
When You See It
When a request to the origin takes longer than Cloudflare's 100-second timeout.
How to Fix
Optimize slow endpoints. Move long-running tasks to background jobs.
Key Differences
304 is a 3xx Redirection response, while 524 is a 5xx Server Error response.
HTTP 304: The resource has not been modified since the last request. The client can use its cached copy.
HTTP 524: Cloudflare-specific. A TCP connection was established but the origin didn't respond with an HTTP response in time.
You encounter 304 when when the browser cache is still valid (If-None-Match / If-Modified-Since headers match).
You encounter 524 when when a request to the origin takes longer than Cloudflare's 100-second timeout.
When to Use Which
For 304 (Not Modified): No fix needed. This saves bandwidth by confirming the cached version is still current. For 524 (A Timeout Occurred): Optimize slow endpoints. Move long-running tasks to background jobs.