• Hi, quick question, how can I verify if my css and js files are being automatically assigned versions for browswer cache busting? I often update my child themes style.css by SFTP, and want to make sure each time I do this, it’s getting served immediately to visitors who may not clear their cache.

    How does wordpress know I’ve uploaded a new style.css to give it a new version? Is there a way for me to verify it is doing this?

    When I look on tools like gtmetrix, I see the it is listed with a query string like
    …style.css?x92105
    but I thought it should be putting something like style.css?ver=1.1

    I’m currently using W3TC and planning to move to WP Rocket shortly. Is W3TC putting that query string, or is it WordPress? Any help educating me on this is appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    It’s not a WordPress query string. The format of the string doesn’t matter, as long as it’s unique it can bust cache.

    Thread Starter acann

    (@acann)

    Sorry for the confusion, let me clarify. I am currently using W3TC and as far as I know, this plugin is adding the ?x92105 query string. If I deactivate W3TC, will wordpress add a ?ver=#.# query string? When I asked WP Rocket support about how their plugin handles “busting” the browser cache for static files, they said

    “Most of the time, the default is that there is a query string on all the assets. Some people remove them with additional plugins, but if you didn’t do that, they should be there….the default is that query strings are there unless you have done something to remove them.”

    I’m trying to confirm if this is the case. Does wordpress do this by “default” and how can I confirm within my theme/install that this is the case? I want to be sure that when I deactivate W3TC and activate WP Rocket that my stylesheets and other static assets will still be “busted” from a browser cache perspective, whenever I update them.

    Thread Starter acann

    (@acann)

    @anevins it appears the version of the plugin or theme is what wordpress appends in the query string. If I am updating a child themes’ style.css how would I increment the “version” number to ensure it is served to repeat visitors? Do I simply edit the commented section at the start of the file?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Determine if static files have version control’ is closed to new replies.