-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Prevent browser caching of javascript packs, using a hash in the filename #267
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
Comments
I guess you are referring to development mode. Because the hash is already available during production. So we can just switch it on for development? cc @gauravtiwari |
@ytbryan Yeah, we can do that, although I never had this problem :) but makes sense to just follow what sprockets is doing so, it works for all cases 👍 |
@ytbryan @gauravtiwari That sounds good. Where is the config for this? |
Never mind, I found it. See the above pull request. Are any tests needed? |
Need to set the right cache-control headers like sprockets does. |
Chrome keeps running old versions of application.js, unless I disable the cache in developer tools. This doesn't happen with sprockets because it includes a hash of the file's contents in the filename, preventing chrome from loading the file from cache unless the hash is the same.
Can we add this feature to webpacker? How would you recommend it be implemented?
The text was updated successfully, but these errors were encountered: