Support » Plugin: W3 Total Cache » How to change minified css file name?

  • Does anybody know how to generate a new file name for the combined css files?
    My problem is that users which doesnt clear their browser cache will see the old css
    styled page.

    Also after purging all caches the file name is still the same.

    Thanks for your help…
    Lukas

Viewing 16 replies (of 16 total)
  • Thank you @hunio,

    Your code works very good.

    I also make small updates and if I want to share edited version maybe someone want to use this type of output.

    My output is like given below;

    <script src="http://domain.com/wp-content/cache/minify/30d40.js?ver=2.1.5"></script>
    <link rel="stylesheet" href="http://domain.com/wp-content/cache/minify/5d995.css?ver=2.1.5" media="all" />

    My Code is like given below;

    function w3tc_filename_filter($minify_filename, $files, $type ){
        
        $themes_version = wp_get_theme()->get('Version');
    
        $minify_filename = $minify_filename . '?ver=' . $themes_version;
        return $minify_filename;
    }
    add_filter('w3tc_minify_urls_for_minification_to_minify_filename', 'w3tc_filename_filter', 20, 3);
Viewing 16 replies (of 16 total)
  • You must be logged in to reply to this topic.