Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Firefox not caching 303 redirects

more options

I work with a web platform where images can be optionally served from cloud storage, S3 in our case. This redirects image requests to a URL containing a dynamic signature which changes per request. For example, to load an image, the browser might do:

-> GET https://www.example.com/file.php/image01.jpg <- HTTP/2 303 See Other

 expires: Thu, 03 Apr 2025 11:23:44 GMT
 cache-control: public, max-age=14400
 location: https://[site].amazonaws.com/...filename%3D%22image01.jpg%22&X-Amz-Signature=...123

and the browser follows the redirect to get the image:

-> GET https://[site].amazonaws.com/...filename%3D%22image01.jpg%22&X-Amz-Signature=...123 <- 200 OK

But if I refresh the page the signature is now different:

-> GET https://www.example.com/file.php/image01.jpg <- HTTP/2 303 See Other

 expires: Thu, 03 Apr 2025 11:24:03 GMT
 cache-control: public, max-age=14400
 location: https://[site].amazonaws.com/...filename%3D%22image01.jpg%22&X-Amz-Signature=...abc

The browser doesn't have this URL cached so it again fetches the image:

-> GET https://[site].amazonaws.com/...filename%3D%22image01.jpg%22&X-Amz-Signature=...abc <- 200 OK

In Firefox that is. In Chrome there's the same following of the redirect when the page is first loaded, but when the page is refreshed the redirect has been cached:

-> GET https://www.example.com/file.php/image01.jpg <- HTTP/2 303 See Other (from disk cache)

 location: https://[site].amazonaws.com/...filename%3D%22image01.jpg%22&X-Amz-Signature=...123

Since the redirect is now to the same URL the image is fetched from the browser cache. Obviously subsequent page loads are faster on Chrome, much faster on image-heavy pages (for example, 6 seconds on Chrome, 1+ minutes on Firefox).

Is there anything I can do to improve this?

Tested with Firefox 136.0.2 and Chrome 134.0.6998.35.

This looks a little bit like [https://bugzilla.mozilla.org/show_bug.cgi?id=1889840 #1889840 will never use an entry in the image cache when loading an image top level that has a redirect] but I think that's referring to images with static URLs.

I work with a web platform where images can be optionally served from cloud storage, S3 in our case. This redirects image requests to a URL containing a dynamic signature which changes per request. For example, to load an image, the browser might do: -> GET https://www.example.com/file.php/image01.jpg <- HTTP/2 303 See Other expires: Thu, 03 Apr 2025 11:23:44 GMT cache-control: public, max-age=14400 location: https://[site].amazonaws.com/...filename%3D%22image01.jpg%22&X-Amz-Signature=...123 and the browser follows the redirect to get the image: -> GET https://[site].amazonaws.com/...filename%3D%22image01.jpg%22&X-Amz-Signature=...123 <- 200 OK But if I refresh the page the signature is now different: -> GET https://www.example.com/file.php/image01.jpg <- HTTP/2 303 See Other expires: Thu, 03 Apr 2025 11:24:03 GMT cache-control: public, max-age=14400 location: https://[site].amazonaws.com/...filename%3D%22image01.jpg%22&X-Amz-Signature=...abc The browser doesn't have this URL cached so it again fetches the image: -> GET https://[site].amazonaws.com/...filename%3D%22image01.jpg%22&X-Amz-Signature=...abc <- 200 OK In Firefox that is. In Chrome there's the same following of the redirect when the page is first loaded, but when the page is refreshed the redirect has been cached: -> GET https://www.example.com/file.php/image01.jpg <- HTTP/2 303 See Other (from disk cache) location: https://[site].amazonaws.com/...filename%3D%22image01.jpg%22&X-Amz-Signature=...123 Since the redirect is now to the same URL the image is fetched from the browser cache. Obviously subsequent page loads are faster on Chrome, much faster on image-heavy pages (for example, 6 seconds on Chrome, 1+ minutes on Firefox). Is there anything I can do to improve this? Tested with Firefox 136.0.2 and Chrome 134.0.6998.35. This looks a little bit like [https://bugzilla.mozilla.org/show_bug.cgi?id=1889840 #1889840 will never use an entry in the image cache when loading an image top level that has a redirect] but I think that's referring to images with static URLs.

All Replies (2)

more options

Hi, it's better to create a new issue on Bugzilla. It is not actionable on the Support side.

more options