4

I am loading a few thumbnail images in my application which are stored on google cloud, I have made the thumbnail objects public and set cache-control: public, max-age:2628000, this seems to be working on chrome where i see the images are getting loaded from cache but on mozilla firefox this is not working, whenever i reload the page, I always see the images are been request from the server. I have also checked that I do not have disable cache checked in developer tools here is a screenshot

enter image description here

Everytime i see bytes transferred and the images are not loading from cache.

Any help in this would be really appreciated. Thanks.

opensource-developer
  • 2,826
  • 4
  • 38
  • 88
  • Have you found a solution for your problem? – Hans-Helge Oct 09 '19 at 15:35
  • 1
    Hi @Hans-Helge, actually mozilla does cache, my understanding of how it works was incorrect. After reading more about it i figured that it was actually caching. So, if you open a link in mozilla and instead of reloading the page, just copy / paste the url in same or different tab, you will see mozilla does cache the images and displayes it from the cache. you can read more about it here https://stackoverflow.com/questions/11245767/is-chrome-ignoring-cache-control-max-age – opensource-developer Oct 09 '19 at 15:50

1 Answers1

2

for anyone who might stumble on this post, I figured out that mozilla was indeed caching the images and displaying it from the cache.

if you open a page and then copy / paste the same url in the same or new tab, you will observe that mozilla displays the cached version of the images, when you reload a page, the images will be requested from the server.

I found out the answer to my post here Is Chrome ignoring Cache-Control: max-age?, please read this as its explained in much more detail here.

opensource-developer
  • 2,826
  • 4
  • 38
  • 88
  • That's corret. In other words. FF caches images but a page reload using CMD + R (on Windows CTRL + R) might ignore the cached images. Only cached files using ETags are properly retrieved from the cache and shown so in the DevTools. – Hans-Helge Oct 10 '19 at 14:58
  • 1
    thanks, was stuck with this problem for some time and your answer helped – Kiran Jun 17 '20 at 21:13
  • As a note, Firefox will also not cache your (text/html) page if any linked resource (ex: fonts) resulted in a 4xx. If you want your html pages to cache, resolve any 4xxs. – Jonathan Rosa Jul 19 '20 at 18:23