Search code examples
wordpressfileminifyblocking

Minified files blocking waterfall (wordpress and W3TC)


Im using W3TC with minify

Im detecting that css and js minified files takes a lot to load, blocking the following elements in the waterfall.

If i use other minification plugin, like head cleaner, those minified files load instantaneously with no blocking at all

Regular uncompressed css and js files are loaded with no blocking nor waiting neither

I don know if the problem is related to number of files minified (can i limit the number of files to minify?) or its related to not limiting the number of characters in file name. Could this really be an issue loading minified files?

Here is an example of the tests:

http://gtmetrix.com/reports/www.externateam.com/eeQZ0MXm

Since i have no clue, any approach would be awesome

Thanks and best regards


Solution

  • W3total cache has this issue where the character limit is added. So every file is, infact, separated through comma and loaded to the url for instance. I am not sure about the orignal format, but it looks something like this: www.example.com/wp-content/plugins/w3total_cache/wp-content/themes/js/jquery.js,wp-content/themes/js/bootstrap.js

    Its fine for a few files but as the number of files grow larger this becomes a mess. Some servers done allow more than a few hundred characters to be added.

    I have seen the link you shared, these files are separately loaded, and this is what has to be expected.

    The only ways to get rid of the blocking time is:

    • by either combining all the files, there is an option in w3totalcache.
    • Or using an async defered blocking (which is also available in w3totalcache).
      • But async method doesn't always work perfectly for every theme. If you dont have a well developed theme you will really have a hard time getting this one to work.