• Hi Alex,

    First, thanks a lot for a great plugin.

    We are experiencing long load times on the CDN for the minified files. We worry that it may be because we have activated the cache buster. We are analying speed with this tool: http://tools.pingdom.com
    When clicking “Performance grade”, we see this recommendation:

    Remove query strings from static resources
    Resources with a “?” in the URL are not cached by some proxy caching servers. Remove the query string and encode the parameters into the URL for the following resources:
    [a list of our minified files

    We need a cache buster, because we want to be able to change our theme css and have those changes reflected immediately. We however worry that having it results in worse performance.

    Here is an idea:
    Instead of appending the cache buster to the url as a search string, it could be made part of the filename. That is, whenever the cache buster string changes, new cache files with new names are generated. For example, a subdirectory could be created with the name of the cache busting string.

    We have tried implementing the functionality by utilizing a filter hook:

    define( 'CHILD_THEME_VERSION', '0.9.4' );
    
    add_filter('bwp_minify_cache_dir', 'elsass_get_bwp_minify_cache_dir');
    function elsass_get_bwp_minify_cache_dir($cache_dir) {
      global $bwp_minify;
      $cache_dir = $bwp_minify->get_default_cache_dir() . CHILD_THEME_VERSION . '/';
    
      if (!file_exists($cache_dir)) {
          mkdir($cache_dir, 0777, true);
      }
      return $cache_dir;
    }

    This however does not do the trick. The subfolder is created. Your plugin puts a .htaccess file in the subfolder. But the files are still written to the default cache dir.

    Thanks in advance and regards,
    Bjørn Rosell

    https://wordpress.org/plugins/bwp-minify/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Feature request: Cache buster in filename’ is closed to new replies.