HTTP 304 Not Modified vs 520 Web Server Returned an Unknown Error
HTTP 304 (Not Modified) is a 3xx Redirection response, while 520 (Web Server Returned an Unknown Error) 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, 520 means that cloudflare-specific. The origin server returned an unexpected response that Cloudflare could not process.
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. The origin server returned an unexpected response that Cloudflare could not process.
When You See It
When Cloudflare receives an empty, unknown, or malformed response from the origin.
How to Fix
Check origin server logs. Ensure responses include proper headers. Verify SSL configuration.
Key Differences
304 is a 3xx Redirection response, while 520 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 520: Cloudflare-specific. The origin server returned an unexpected response that Cloudflare could not process.
You encounter 304 when when the browser cache is still valid (If-None-Match / If-Modified-Since headers match).
You encounter 520 when when Cloudflare receives an empty, unknown, or malformed response from the origin.
When to Use Which
For 304 (Not Modified): No fix needed. This saves bandwidth by confirming the cached version is still current. For 520 (Web Server Returned an Unknown Error): Check origin server logs. Ensure responses include proper headers. Verify SSL configuration.