-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Create Block: Use the same version for stylesheets and scripts #23137
Conversation
Size Change: 0 B Total Size: 1.13 MB ℹ️ View Unchanged
|
I like this idea. Out of curiosity, did you test if the version (hash) changes when only CSS assets get modified? That would be the only concern here. |
I just tested it again and the hash appears to only change when a CSS file which is not |
I tested it locally, it looks like this version (webpack hash) generated is based on the content of JS file. We would need to find a way to create an asset file with the version that is targeting the content of CSS file. |
I'm observing that issue as well. So it's only |
Closing this for now. There should be a better/more reliable way to generate the version of a stylesheet. See also #22519. |
Description
Since CSS and JS files are generated by the same build task at the same time we can also use the same version. This replaces the
filemtime()
call with the version provided by the assets file.This prevents asking the file system for data which may be even unreliable when used in server setups with horizontal scaling.