Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter rosen4o

    (@rosen4o)

    There is hook for wp_default_styles but w3 total cache didn’t user version specified there

    function my_wp_default_styles($styles)
    {
    //use release date for version
    $styles->default_version = “20160714”;
    }
    add_action(“wp_default_styles”, “my_wp_default_styles”);

    When you update the file(s), why don’t you just use the W3 cache Empty option?

    Logged in under your WordPress Admin, on any webpage, at the top you have “Performance” with a dropdown list “Empty All Cache” or “Empty Modules > Empty Page Cache”.

    Adding version control parameters to JavaScript and/or CSS tends to just slow you down.

    If you do want version suffix, try the option under W3 cache called “Prevent caching of objects after settings change” I believe? I haven’t tested it myself but this might be what you are after?

    Thread Starter rosen4o

    (@rosen4o)

    I’m using it but on some users continue to see old css
    There need to be preformed refresh to get the new css and then everything is ok

    These users obviously had old versions of html and css/js in their browser cache, so actually a “Browser cache” problem instead of a “Minify” problem.

    Thread Starter rosen4o

    (@rosen4o)

    Yes this is correct but I want with w3 to be able to force download of the new css files

    Did you make sure to clear the page cache after you enabled the query strings?

    Thread Starter rosen4o

    (@rosen4o)

    Yes of course

    I, too, would like to see purging all caches change the minified filenames to help denote it’s a new version of that file (which the new page cache will use instead moving forward). Why not have some way of having the minified files be able to say it’s a new version?

    My ideal setup would be to have the default W3TC browser cache expiration for CSS & JS files as well as having the CSS & JS minified. Now, I just need the ability to purge these caches to display updated JS/CSS code when needed. Otherwise, past visitors will potentially be using CSS/JS from weeks/months ago due to browser cache serving the old file since the minified filename didn’t change (even though the content did change).

    Maybe the minified filenames periodically change as the page cache expires? I’m not sure, but currently I see using all of the features of W3TC in an optimal fashion leaves the minify feature with a bad bug.

    Let me know if you hear anything about a workaround/fix/etc. or if it’s already accounted for within W3TC behind the scenes. Thanks!

    I have also posted this at the similar topic at https://www.ads-software.com/support/topic/minification-and-cdn-minified-file-name-doesnt-change-when-its-content-does/#post-8863621

    • This reply was modified 7 years, 8 months ago by KZeni.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘CSS and JS minify’ is closed to new replies.