• I like this plugin, however I found that it was causing caching issues with JS+CSS files that rely on querystrings to invalidate outdated versions and update themselves on the client. I have taken a peek at the code, and there seems to be no way to disable querystring processing; that’s a bummer, because otherwise this is a top plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Raul P.

    (@alignak)

    Hi there @leonardo-gaiero

    While I appreciate the feedback, can you kindly open a support thread instead of directly posting a review?

    I’ve added many features based on user requests, but I think you are missing the main point of this plugin.

    The goal of the plugin is to do speed optimization by merging and minifying css and js files as much as possible (reducing requests), but also to remove query strings (so that those files are always cached).

    If you’re familiar with pingdom or gtmetrix, one of the recommendations is also to remove query strings from static resources (css, js, images, etc), therefore the plugin needs to remove query strings from your static resources. It’s essential to do that, also because certain browsers won’t cache your css or js files if the have a query string, even if that query string never changes.

    You can read about it here: https://www.keycdn.com/support/remove-query-strings-from-static-resources/

    Nevertheless, the plugin has several ways to solve your problem.

    a) If you have a css or js file that changes frequently, there is a way to ignore as many files as you wish by wildcard. Just take a look at the ignore list: https://wordpress.org/plugins/fast-velocity-minify/faq/

    This is possible but not recommended, since your goal should be to do the changes you need (developing) and then deploy those changes as production ready. The recommended step for anything however, is to purge all your caches when you edit css or js files.

    This is true for your cache plugin as well as FVM, which brings us to b).

    b) You can invalidate and purge the cache anytime you do changes to a css or js file, although it’s recommended that you disable any cache and any minification plugin, if you are doing development (such as changing css and js) and then purge the cache and re-enable the plugin.

    For example, if you edit a css file you can go to FVM status page and purge the cache.
    It will regenerate a new set of files with a different timestamp (and file name), thus avoiding any browser cache. This is similar of changing the query string, but better.

    c) Some themes, include a dynamic generated css file based on PHP (bad for performance) and that usually includes a query string that changes every single time, regardless of the contests changing or not.

    This plugin will fetch that file via HTTP while merging it together, BUT because the query string changes all the time, it’s considered a new file.

    That makes FVM generate a new file name on every page load to follow the same functionality, but it’s highly inefficient to do this.

    If you have such a file, it’s recommended that you add the partial path to the ignore list, without query string. For example, if your css file is themes/whatever/assets/css/dynamic?n=xpto your could add themes/whatever/assets/css/dynamicto the ignore list, and FVM would leave it alone.

    d) If you have a static css file that uses a query string based on the file timestamp for your css file (or if you change the query string on the enqueue system), FVM will purposely ignore that query string.

    You must purge the cache on FVM and your cache plugin, once you’re done with the changes, and it will generate new files for you. Therefore, there’s no need to change the query string.

    If you however, have a different use case scenario, do let me know and I’m certain I can do something about it.

    Thanks,

    Raul

    Thread Starter Leonardo Gaiero

    (@leonardo-gaiero)

    Thank you for your very exhaustive step-by-step reply; my scenario popped up because after some plugins got updated, my client was still loading their outdated assets, which led to broken functionality when the older version of an asset would load. Thinking about it, it was probably an issue with cached HTML files, since the page was attempting to load a JS function that wasn’t there anymore (because the cached version of the script got updated while the page didn’t, thus referencing a obsolete function). I would have to do further testing on this.

    You’re also right about the review, but it was still a very positive one; however, since logic tells me that the JS querystrings were not at fault, the topic is no longer valid and it’s only fair to bump the score up as a consequence. Cheers.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Good, but needs some way to ignore query strings.’ is closed to new replies.