thomasxwright / Feather-Trace

1 stars 0 forks source link

Fix caching of old versions of the website #42

Closed thomasxwright closed 1 year ago

thomasxwright commented 1 year ago

New deployments are not working without hard refreshing your browser.

Fix dat

https://stackoverflow.com/questions/47659277/trigger-hard-cache-refresh-when-index-html-changes-in-create-react-app-deploymen#52919124

thomasxwright commented 1 year ago

A browser tries to request the backend/build/static/js/main.lsjfiesliej.js file it last got. it doesn't check for the updated version.

check this out: https://stackoverflow.com/questions/65528622/how-to-specify-a-cache-control-header-for-index-html-in-create-react-app

thomasxwright commented 1 year ago

image i tried accessing feather trace from two browsers, each of which last accessed it at different builds. you can see it received requests for two distinct main.js files -- each one was the name of the main.js file that came from the build that browser last successfully loaded.

thomasxwright commented 1 year ago

If our caches ever cause a problem, and sometimes they can, it's good to know how to clear them. In our project, go to Actions > (Sidebar) Management > Caches. This is the list of caches saved for the project. We can use our naming format to identify which cache file is for what. https://fly.io/docs/elixir/advanced-guides/github-actions-elixir-ci-cd/#retrying-failed-builds

thomasxwright commented 1 year ago

https://community.fly.io/t/node-js-express-setheaders-for-cache-control-client-side/8839

this person gave me the solution.

image