Remove query strings from static resources
August 28, 2017, 05:46:42 am
I wish to know the effects of removing the query strings from ElkArte combined files for js and css as they are considered as static resources. I am testing it by commenting out this part ". $this->_archive_stale;" in the site combiner file. And I wish to know how do I remove the query string from "fontawesome-webfont.woff2?v=4.4.0" and its effects if I do so.
Re: Remove query strings from static resources
Reply #1 – August 28, 2017, 07:37:09 am
emanuele
Global Moderator
The query is there to "force" refreshing on updates/upgrades. What would be the advantage of removing it?
Re: Remove query strings from static resources
Reply #4 – August 28, 2017, 08:43:12 am
i ignore those warnings. too much hassle with minor benefit.
Re: Remove query strings from static resources
Reply #5 – August 28, 2017, 10:22:21 am
Ignoring is a good choice actually. But I like learning and doing it the other way too. This is my hobby, so nothing serious.
Re: Remove query strings from static resources
Reply #6 – August 28, 2017, 10:58:39 am
emanuele
Global Moderator
And considering how the cache of Chrome is persistent and "difficult" to cleanup, change the URL is actually the only reliable way to be sure the content is changed when it really needs to be...
Re: Remove query strings from static resources
Reply #7 – August 28, 2017, 02:12:57 pm
Out of curiosity, which tools warn specifically? Using ?v=1.2.3 is quite common for good reason. You could also use something like /scriptname/1.2.3/script.js or /scriptname-v1.2.3.js instead but that might be slightly harder to implement on the server-side.
Re: Remove query strings from static resources
Reply #12 – August 30, 2017, 02:42:45 am
And a cron job can be set up to purge old files with glob() om nom nom.