HTTP

HTTP 304 Not Modified vs 521 Web Server Is Down

HTTP 304 (Not Modified) is a 3xx Redirection response, while 521 (Web Server Is Down) 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, 521 means that cloudflare-specific. The origin server refused the connection.

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 refused the connection.

When You See It

When Cloudflare can't establish a TCP connection to the origin server.

How to Fix

Check that the origin server is running and the firewall allows Cloudflare IPs.

Key Differences

1.

304 is a 3xx Redirection response, while 521 is a 5xx Server Error response.

2.

HTTP 304: The resource has not been modified since the last request. The client can use its cached copy.

3.

HTTP 521: Cloudflare-specific. The origin server refused the connection.

4.

You encounter 304 when when the browser cache is still valid (If-None-Match / If-Modified-Since headers match).

5.

You encounter 521 when when Cloudflare can't establish a TCP connection to the origin server.

When to Use Which

For 304 (Not Modified): No fix needed. This saves bandwidth by confirming the cached version is still current. For 521 (Web Server Is Down): Check that the origin server is running and the firewall allows Cloudflare IPs.

Learn More