HTTP

HTTP 304 Not Modified vs 307 Temporary Redirect

Both HTTP 304 (Not Modified) and 307 (Temporary Redirect) belong to the 3xx Redirection category. 304 indicates that the resource has not been modified since the last request. The client can use its cached copy. Meanwhile, 307 means that the resource temporarily resides at a different URL. Unlike 302, this guarantees the HTTP method will NOT be changed.

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 resource temporarily resides at a different URL. Unlike 302, this guarantees the HTTP method will NOT be changed.

When You See It

When you need a temporary redirect that preserves the request method (POST stays POST).

How to Fix

Follow the Location header using the same HTTP method.

Key Differences

1.

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

2.

HTTP 307: The resource temporarily resides at a different URL. Unlike 302, this guarantees the HTTP method will NOT be changed.

3.

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

4.

You encounter 307 when when you need a temporary redirect that preserves the request method (POST stays POST).

When to Use Which

For 304 (Not Modified): No fix needed. This saves bandwidth by confirming the cached version is still current. For 307 (Temporary Redirect): Follow the Location header using the same HTTP method.

Learn More