How to Fix the W3-Total-Cache CSS Minify Bug

by Martin Malden

Speed. As I mentioned back here the Thesis theme applies a date stamp to CSS files when they’re updated.

It does (did) this in order to ensure the latest version of your site is always displaid to visitors.

Unfortunately that process confused the life out of the W3-Total-Cache plugin (because it had the effect of creating a new filename) and you had to add the ‘new’ CSS files to the minify section whenever you made any changes to your site.

Which was a bit of a pain.

But, because of that, when the latest version of W3-Total-Cache came out a couple of weeks ago and destroyed the styling and layout of my sites, I just assumed it was related to the Thesis date stamp.

However, Chris Pearson released Thesis 1.8.1 a few days ago in which he removed the process of date stamping CSS files.

So I upgraded all my sites only to find that the layout and styling was, once again, destroyed.

The cause and the solution

It turns out there’s a bug in W3-Total-Cache which is preventing it from caching CSS files properly.

When you add your CSS files to W3TC (by caching them) they’re not separately uploaded to the browser and, because of the bug, W3TC is not presenting any CSS files either. The result is a destroyed layout.

The immediate workaround is simple:

  1. Switch the Minify mode on the General Settings page from auto to manual
  2. Remove all the CSS files from the Minify settings page
  3. Empty each of your Caches

You’ll now be good to go, but be sure to check your site from the ‘outside’ – meaning log out of your admin area and clear your browsing history before checking it as if you were a first time visitor.

Your CSS files are not being cached with these changes but at least your site is functional, and the other caching functions are working properly, so you are getting a good proportion of the optimsations.

I believe a new version of W3TC, which addresses this problem, is in the works and will be released shortly.

Update – 31 May, 2011

A new version of W3TC was released today. I’ve updated all my sites and the CSS bug is fixed – everything is working fine now. If you’re still experiencing the problem make sure you update to W3TC 0.9.2.2 (or later, of course).

Cheers,

Martin Malden

 

Please share this article - I'm counting on you!
       
Found this article useful? Get free updates!

Get regular updates, plus a free eBook on how to set up a business online - join us!

Your details are safe with me.
My Privacy Policy.

Previous post:

Next post: