-
-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version bundle.js & style.css #23
Comments
this would probably break the serviceworker setup since the html has to change in order to update the bundle url, right? |
I'm not sure what you mean. The html would be different per build, and would be cached alongside the new build assets too. You'd be looking at fully immutable builds, from version to version. |
Can't do immutable HTML since that's the entry point - its url has to be |
Correct me if I'm wrong, but if you're not fingerprinting the assets, can't a user find themselves in a situation where their browser has evicted bundle.js from the cache, but not style.css, resulting in a newer version of bundle.js being styled with the previous version of style.css? |
Sorry, "immutable" as in all assets. Only the index.html and sw.js filenames will be the same, but their contents always point to new files. |
@dstaley right, that's what I'm trying to voice. When assets arent uniformly cached and versioned, you give yourself a window of being caught in between states. |
html-webpack-plugin has a |
Correct. Would be the same process and tasks regardless of hash or filename addition I've been doing this for my projects and |
What's the status of this? It would be great if there is an option in the cli to append hash on the bundle. |
I think the hash-in-querystring approach is doable in the short term. |
I have a fork that added hashing the bundle. I'll send a PR |
@developit What's your hesitation to adding filename-hashes? I'm not sure, but I don't think that the querystring approach is compatible with even all the servers we offer ootb. Certainly more error-prone in userland with user-setup-servers... perhaps. |
@lukeed It's true. I'm having a hard time fighting with nginx and querystring caching |
I would call this "mild priority" right now, simply because, as is,
bundle.js
is the majority of the application weight//network transfer. It's set for a maximum of 1 hour, which means that users will need to redownload an entire application, regardless of any changes it may or may not have had. Plus, this kind of impedes the function of offline/sw-precache.Also, in the rare event that my app goes from v1 to v2 within the hour that User has cached my bundle, their next request would grab all the v2 chunks &
sw.js
, which still points to non-versionedbundle.js
, which results in User working with a mismatched set of assets... the majority of which (in bundle) is now outdated.If we're on the same page here, we'd need to:
bundle.js
, like everything elsebundle.js
link per-build; handled byhtml-webpack-plugin
This all applies to
style.css
as well: same tasks & reasoning.The text was updated successfully, but these errors were encountered: