Open eroux opened 3 years ago
here's a screenshot of the headers of the broken app, which show a different Etag:
I wonder if it might come from the (from service worker)
thing... (see here ?)
It still happens that after a deploy some users are left with a blank page and need to reload the page with no cache because the name of the js file changed. I'm wondering if we could use the onerror=
tag on the <script>
tags (as indicated in this answer) ? ideally it would:
Location.reload()
)good idea, thanks! deployed something like that here and changed index.html to point to wrong js file: http://library-dev.bdrc.io/
now the thing is forcing full page reload may not be as reliable as hoped: https://developer.mozilla.org/fr/docs/Web/API/Location/reload#location.reload_na_pas_de_param%C3%A8tre
(tested locally with serve
on /prod
, when I manually force reload it shows the error message, but when it reloads itself it shows previous version)
so best I can think of is adding a link to https://en.wikipedia.org/wiki/Wikipedia:Bypass_your_cache available in Chinese as well (but not in Tibetan...)
thanks! can we replace with something like:
Sorry, the website encountered an error while loading, please reload the page with ctrl + shift + r on PC or Apple + shift + r on Mac
it will be very helpful, thanks!
done, added a bit of css: http://library-dev.bdrc.io/
ah, that's better thanks!
I'm not sure why, but sometimes (even when the cache is off), the browser doesn't seem to want to update the main html, which leads to the wrong .js file being called and not found... This happened to TD recently, here's a screenshot:
at the time of the screenshot, the javascript bundle already changed name (to
main.64a5670b.chunk.js
). It doesn't make an awful lot of sense since nginx should detect that the files changed and change theirEtag
header (at the time of the screenshotW/"60f93b11-bd8"
)... difficult to debug because difficult to reproduce but let's track it