Hi, @gilesbutler. Netlify deploys are atomic. When you deploy a site all files are included for that deploy. Any files for previous deploys no longer exist unless they also exist in the current deploy.
I’m also assuming the site uses the single page application rule (aka SPA rule) below:
/* /index.html 200
So, when a new deploy occurs the app.<previous_hash_here>.js
file stops existing. So, index.html
is served for that path instead of the expected javascript. It is a 404 not found being turned into a 200 with index.html
because of the SPA rule.
The issue here, even without the filenamehashing
, is that people that are in the middle of navigating the site will attempt to load the next chunk of javascript but the versions of that javascript have changed from what the currently loaded browser window expects. Hashed name or non-hashed name - either way - if the chunks have changed, there may be incompatibilities between the currently loaded javascript and the next chunk.
It seems to me that a key question here is: “How does the current page know when it’s javascript and therefore it’s references to other chunks is out of date and that he current javascript itself must be reloaded before navigating to the next route/page?”
My best guess would be that, before the site loads any new javascript, the browser would do a HEAD request on the currently loaded app.js asset and reload it if its etag
has changed. I would hope that there is a built-in solution for this already in Vue but I’m not familiar enough with Vue to answer.
Do you know if this is already a solved problem with the Vue framework?