I'm updating a staging website for a client with SiteGround hosting. Despite bumping the theme version and flushing the SiteGround cache, the client isn't getting the latest JavaScript updates.
Digging in to this further, I noticed that the scripts are being served from ./wp-content/uploads/siteground-optimizer-assets/scripts.min.js
. The files are served with a +1 year expiry time, so it's no wonder the client is not seeing the latest changes.
I found the setting in SiteGround responsible for removing the query string parameters and disabled the option. Now things are working as expected, with a version number added to the URL.
I'm puzzled though, why this is a recommended option to enable and why SiteGround say this:
Note that removing the query strings will not stop these resources from being loaded anew once you make changes to them, so you should not worry about that.
How can that be the case?
Probably for seo reasons
Some CDNs tend not to cache static assets with query strings, so a lot of “optimization” plugins used to do it in the past. Some others do it to “hide” the WordPress version your site is running on. These practices are mostly obsolete and should not be used. Static assets with query strings get cached just fine, and you should be the running the latest minor point release of a relatively recent WordPress version at all times.
Are you using a CDN with it ? Meaning Cloudflare ?