W3 Total Cache Minified CSS & JS Load Too Slow

Our Score
Click to rate this post!
[Total: 0 Average: 0]
W3 Total Cache loading minified CSS and JS very slow.
W3 Total Cache loading minified CSS and JS very slow.

I was having trouble with my minified CSS and JS loading too slow from “/wp-content/cache/minify/000000/”, 2-10 seconds was adding to a page load. I searched the web for an answer, the solutions I found ranged from:

  • Disable minify for logged in users
  • Server not configured correctly

I was pretty sure the server was configured correctly, and I wanted to find what the real problem was, not just avoiding it by “Disable minify for logged in users”.

TROUBLESHOOTING THE MINIFIED CSS

I loaded up the minified css directory “/wp-content/cache/minify/000000/” in my FTP client. I then loaded up the minified CSS directory in my FTP client, as well as loaded up the website in question with Chrome Developer Tools window open. I compared each minified file with the ones in the Chrome Developer Tools window and noticed the minified files with the longest filenames were not being saved to the directory.

SOLUTION

The solution to the minified CSS and JS loading too slow was to check “Disable minify automatic file name length test” and then manually finding the right “. I again loaded up the minified CSS directory in my FTP client, then the W3 Total Cache’s minify page in the WordPress admin. I started by lowering the “ in small increments (by default it is set to 246), and refreshing my FTP client to see if the minified CSS of the longest filename was saved to disk in “/wp-content/cache/minify/000000/”. I first set it to 220, then 215, 210, 205, 200, 195 and finally to 190. 190 was the magic number!  After setting  to 190 the page loaded slow the first time as W3 Total Cache generated the files, after that all pages loaded as fast as I expected.

CONCLUSION

W3 Total Cache was trying to generate the minified CSS files in the “/wp-content/cache/minify/000000/” directory on each page load. Any file that was too long was not saved to the minified CSS directory “/wp-content/cache/minify/000000/”. In turn W3 Total Cache was trying to do what it was programmed to do, generate the minified files and save them to disk, only to have any file with a filename length over 190 to never be saved. Perhaps the developers of W3 Total Cache could add an error message notifying us when a file could not be saved?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.