Remove query for resource

As topic. I want to ask is it possible to remove query in resources?

And also why ghost uses query? Is the resource changing frequently?

@andrewyg could you maybe rephrase your question? What are “query” and “resource” referring to?

From GTMetrix, it suggest me remove query following for like JS resources

Something like /asset/js/libraries.js



OK, so you’re referring to how assets are loaded like this:

<link rel="stylesheet" href="/assets/built/screen.css?v=ab22cddc39">

The ?v= query param here is for cache-busting so that when you upload a theme change or switch themes your changes are actually seen by site visitors instead of a proxy/cache or your visitor’s browser cache keeping the old version of the file around for up to a year.

The GTMetrix recommendation is just that and in my opinion is out of date - I haven’t seen a cache which doesn’t cache files with query params for many years. Best advice is to not follow these sorts of tools blindly; find out why they are recommending certain changes and whether those changes come with downsides :wink:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.