Support » Plugin: W3 Total Cache » How to update the query string

  • Resolved realmccoyzz

    (@realmccoyzz)


    Thank you.
    I want to know how to update the query string.
    For example, W3TC grants a query string as below.
    <img src="https://sample.com/wp-content/themes/sample/images/sample.png?hoge" alt="1">

    When will this query string be updated?
    1.When the contents of the file are changed?
    2.When the W3TC object cache runs out?

    I found the following description on the W3TC settings screen.

    Prevent caching of objects after settings change
    Whenever settings are changed, a new query string will be generated and appended to objects allowing the new policy to be applied.

    Does the “setting” here mean changing the setting screen of W3TC?
    or, When the contents of the file are changed?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @realmccoyzz

    Thank you for your question and I am happy to assist you with this.
    When the option “Prevent caching of objects after settings change” is enabled, the W3TC is adding a random query string to the files ?xNNNNN. You can activate the setting globally, or use it only for Media&Other files (images) or JS&CSS separately. SO instead of enabling the option in the General sub-box under Performance>Browser Cache, you can enable the option for each file type in designated sub-boxes.
    So for example, you have minified JS and CSS the file is generated in the cache folder /wp-content/cache/minify/j3245.css?xNNNNN
    After some time, if you decide to change any css file which is already minified after you make changes and purge the cache you need to Update the media query string so that a new string can be added, and therefore the browser can fetch new, changed files to serve them for the users.
    I hope this helps!
    Thanks!

    Thread Starter realmccoyzz

    (@realmccoyzz)

    Thank you so much @vmarko !
    Will this query string be updated automatically?
    Even if I changed the contents of the media, it was not updated automatically,
    The query string was updated only when the “Update media query string” button was pressed.
    Is there a way in W3TC to automatically update the query string when I change the contents?

    • This reply was modified 1 year, 2 months ago by realmccoyzz.
    • This reply was modified 1 year, 2 months ago by realmccoyzz.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @realmccoyzz

    Thank you for your question.
    No, once you make the changes, you need to manually update the query string by clicking on the ​“Update media query string” button.
    W3TC cannot know which files are changed if they have the same name. This is why the mentioned button exists.
    Thanks!

    Thread Starter realmccoyzz

    (@realmccoyzz)

    Thank you so much @vmarko !
    The problem was solved

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to update the query string’ is closed to new replies.