-
Notifications
You must be signed in to change notification settings - Fork 21
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
Don't output webpack generated assets in a version number folder #57
Comments
We can do it but assets that are in the static folder will not be versioned when we change this and can be cached by the server. So we need a solution for those files. We can maybe add a hash to the static folder so they are never cached. |
It's fine to have both, a version folder for static content (images, json, videos) that is loaded by html or xhr requests, and have the asset folder outputted by webpack with a hash in the filename. Only thing that needs to be done is having a proper cleanup script that uses information from each build to know which files aren't used anymore in the recent X builds. We already have something for another project, and could make that available as node module to include here as well. |
@hjeti All assets should still be versioned either by a version number folder or hash versioning. To clarify, this is my suggestion:
|
@flut1 I've merged your PR |
We are already using hash filenaming for some assets. Which is great, because this optimizes caching: changed files get a different filename but assets that have not changed will still have the same path so they are cached by the browser. However, by putting assets in a /version/xxxx folder the path will change on every build, regardless of the contents of the asset has changed. This makes the hash in the filename redundant.
The text was updated successfully, but these errors were encountered: