Un1 Un1 - 7 months ago 12
HTML Question

Why some browsers won't update https page after I deploy changes?

My problem is that browsers won't show updated page (sometimes) until I press f5 manually


  • I have my test site deployed to the Firebase (and by default is https)

  • Site is HTML5

  • It's not the problem with this particular site (tried different sites 1.simple html, css site and 2. polymer starter kit with gulp etc.)



In order to resove the problem I've tried to add this code to the HEAD (didn't resolve the problem)

<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="Cache-Control" content="max-age=0">



  • When I change anything (let's say add p-tag with random text) and deploy the site again I won't see changes in cases as following:



FIREFOX:

Does NOT show updated page in case:


  • Type site name in a new tab

  • Or click on the site from bookmark tab

  • I click it 2nd (3rd, ... etc) time on the bookmark bar

  • or type manually 2nd (3rd, ... etc) time in a new tab



Does show updated page in case:


  • If I simply press f5.



CHROME and Opera

Does NOT show updated page in case:


  • Type site name in a new tab

  • Or click on the site from bookmark bar



Does show updated page if:


  • I click it 2nd time on the bookmark bar

  • or type manually 2nd time in a new tab

  • If I simply press f5



EDGE browser

Works perfectly (how is that even possible??) in case:


  • Type site name in a new tab

  • Or click on the site from bookmark bar

  • If I simply press f5.



How come that EDGE browser in the only one that update the content of the page, does http-equiv works only with IE, EDGE or what ?

How do I resolve that problem? How do I make Chrome, Firefox, Opera to look for changes and update it if needed (or just ignore the cache and load it every time without any cache)?

Do I need to put some attributes to firebase.json that would look for changes on the page and send updated page to visitors ?
Please help, I spend like 16 hours on research and couldn't find the solution

Answer

Your host could have a 1 hour cache delay on the server, that is overriding anything you put in your HEAD. You should check this with Firebase

Alternately, you could run a page reload after page loads for the first time with Javascript, this would get you the same effect as F5.

Something like:

location.reload(true);