HTTP

HTTP 304 Not Modified vs 416 Range Not Satisfiable

HTTP 304 (Not Modified) is a 3xx Redirection response, while 416 (Range Not Satisfiable) is a 4xx Client Error response. 304 indicates that the resource has not been modified since the last request. The client can use its cached copy. In contrast, 416 means that the server cannot serve the requested byte range. The Range header value is outside the resource's size.

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

The server cannot serve the requested byte range. The Range header value is outside the resource's size.

When You See It

When requesting a byte range beyond the file's actual size.

How to Fix

Check the Content-Range in the response for the actual file size and adjust your Range header.

Key Differences

1.

304 is a 3xx Redirection response, while 416 is a 4xx Client Error response.

2.

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

3.

HTTP 416: The server cannot serve the requested byte range. The Range header value is outside the resource's size.

4.

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

5.

You encounter 416 when when requesting a byte range beyond the file's actual size.

When to Use Which

For 304 (Not Modified): No fix needed. This saves bandwidth by confirming the cached version is still current. For 416 (Range Not Satisfiable): Check the Content-Range in the response for the actual file size and adjust your Range header.

Learn More