minify cache busting not changing the hash
-
Need to do a hard refresh in a browser to load the new changes when I clear the cache in hummingbird.
So, is there any way to change the minified assets hash when clearing cache in hummingbird?
-
I hope you are doing well.
When using the Hummingbird > Assets Optimization and flushing the entire cache it should flush the Assets Optimization too which will prevent the problem.
A good idea is to enable the Hummingbird > Page Caching > Clear full cache when post/page is updated & Hummingbird > Page Caching > Settings > File Change Detection > Automatic.
It is important to not use any extra caching plugin that could make an extra cache layer and verify for any extra server side caching or services like Cloudflare.
Let us know if those settings prevented the issue.
Best Regards
Patrick FreitasHi Patrick,
Thanks for the response.We tried Hummingbird->Clear cache the cache with “Asset Optimization cache” option. (In the dashboard)
And It’s clearing the cache but not changing the hash file names in the cache.So when we access the site in the browser next time, the changes not effecting while do a hard refresh.
So you mean, need to enable page cache to overcome this problem? Since currently we don’t enable page cache.
Thanks!
-
This reply was modified 4 years, 11 months ago by
satheeskumars.
Thanks for reply!
You are right about hashed file names of optimized assets. They are not changed upon clearing Asset Optimization cache and they won’t be cleared upon clearing Page Cache (if enabled either.
That is, unless the actual file name of original asset has been changed or a version number appended to it has changed. In general, it’s a plugin/theme developer’s responsibility to make sure that version number of a given JS/CSS asset changes when updates to it are made.
So depending on where such CSS or JS that should be refreshed is coming from it may suffice to just disable the “Remove query strings from my assets” option on “Hummingbird -> Advanced Tools -> General” page, if it’s currently enabled.
If it doesn’t help or it’s already disabled then you can try this plugin in addition:
https://ww.wp.xz.cn/plugins/super-light-cache-buster/
Kind regards,
AdamHey Adam,
Thanks for the reply.I’ll check with your suggestion above and get back to you!
Great thanks for the responses!!!
Hey Adam,
I have tried to append a version to modified file since we can’t change the file name every time when we do a modify in a file. And then try with clearing cache.Unfortunately the cache file’s names not changing. Also still need to do a hard refresh to load the new changes.
And already there were the setting that you have mentioned above.
Also I think it’s not suitable method as go for another plugin to prevent the cache version. since it’s cause more manual work.Let me know if you have any idea from your end.
Thanks!!!
Hi @satheeskumars,
That’s odd, in general, if there are any changes made in the website, Hummingbird will re-check the files automatically and it’ll create new minified URLs, so the changes should have been visible immediately.
Could we know what type of changes you are noticing not reflecting immediately? Ie CSS or JS changes? How are the changes done on the website side?
Are you noticing this behaviour with any specific theme? Do you notice the same if you switch to a default WP Theme?
Is it possible to share a page URL where you notice the issue and also a link to the minified URL and a screenshot if possible on where you notice the issue once it’s hard refreshed?
Looking forward to your response.
Kind Regards,
NithinHi Nithin,
Thanks for your response.We did both JS, CSS changes. And we are doing the server changes with sftp. Also the same behavior is happening in local with xampp setup.
Please note that we are using a different theme instead of default one.
And I have tried with appending a date string as version to each js and css files after each change.
Eg: style.min.css?ver=20210705_1, init.js?ver=20210705_1.Please find some set of cache files remaining with same file names in “wp-content/uploads/hummingbird-assets” folder.
dd16afde1ccff851616b48fd953cf082.css
d2d811a7323a5aa37e0bf96448143a2c.js
c54731d350949dcb4a9e49e7bf641e3a.css
251197421dede2cf8d69b11a12f86eaf.jsFor your information, When I do a hard refresh only above files last modified date showing as recent. (In the developer console’s network tab)
Eg: last-modified: Thu, 01 Jul 2021 12:30:02 GMTFor a security purpose I not shared the live url here.
Let me know if you need any further information.Looking to hear from you.
Thanks you!!!Thanks for response!
How are you loading CSS/JS to the site then – is it using core WordPress “enqueue” functions for scripts and styles?
If yes, do you actually change version number that’s passed to these functions or you append it in some other way (e.g. via custom code)?
The point is that to make it work correctly, this should be happening:
– whenever anything in script or style file is changed the original file should be updated but also the version number parameter passed to relevant “enqueue” function should be changed (increased);
– even if the file name is not changed, Hummingbird should be able to notice that change (though I’d recommend setting “File Change Detection” option in “Caching -> Settings”) and automatically clear caches; while asset optimization regeneration would also be triggered it would “force” it to use up to date versions of these file;
Appending version number via some custom code may not work because it might force browser to re-read the file but the content of optimized file that it reads would still be “old” – because there’s a good chance that such version numer (as URL parameter) would be actually added after file is already optimized/processed by Hummingbird and also it wouldn’t trigger Hummingbird’s “file change detection”.
Also important is to be sure that no other cache “gets in a way”. For example, if there’s some CDN, it may implement additional caching or if there’s server-level cache it may actually be serving “cached” older version of optimized JS/CSS assets.
Kind regards,
AdamHi @satheeskumars,
Since we haven’t heard from you in a while, I’ll mark this thread as resolved for now. Please feel free to re-open the thread if you need further assistance.
Best Regards
Nithin -
This reply was modified 4 years, 11 months ago by
The topic ‘minify cache busting not changing the hash’ is closed to new replies.