W3Total Cache for WordPress

I’m having big problems with W3 Total Cache plugin on WordPress sites.

Sometimes it can’t find the CSS file. If you view the page source the file is called /wp-content/w3tc/min/050252be64508eba7ffa8f49c5f7bca0.2032661377.css

which is “Bad file param format.” if you click on it.

Does anyone use this caching plugin for WordPress? It’s quite well regarded.

Anyone have any idea about the settings on a DH VPS with PHP Cache turned on?

W3Total cache created me a lot of problem specially the minify and combine feature. I have replaced the plugin with HyperCache. Now my blogs works fine. If you want minify the css file the best practice is to minify the files and upload to the server or use wp-minify.

Thank you anand, I’ll try that.

I use extensively, and although there are minor quirks with some of its features, most of them I have only myself to blame for — W3 Total Cache is tough to configure properly :slight_smile:

For example, the error you’ve got with CSS was due to the gzip settings. I always had problems with compressed files under DreamHost — they come and go, as DH upgrades Apache and PHP, but they never completely go away.

Once I turned gzip compression off on W3 Total Cache, my settings worked fine with DH :slight_smile:

I use W3 Total Cache exclusively on all my WordPress installations, except on test blogs. That’s possibly 50+ installs I think. All of them work fine, although a few have a tendency to drop a 404 when the MySQL server is too slow too respond. To deal with those trouble spots, I pushed those sites into CloudFlare, which ties neatly into W3 Total Cache, and, depending on the site, can give a thorough boost into performance — for free.

This is really a shame. I’ve had support here at Dreamhost tell me categorically not to use that plug-in.

I’m on a VPS 500MB RAM. I have PHP cache active on the server and, sometimes, Page Speed Optimization active on the domain. I don’t know if that has any bearing on why I can’t use W3T cache.

I can’t see how to turn gzip compression off on W3 Total Cache.

Can I ask, Gwyneth, how do you do that and if your set up is similar to mine.

Oh my, really?!? What reasons did they give for not using W3 Total Cache? It’s just because DH’s technical support are usually very good at spotting troublesome plugins, and I most certainly would like to know their reasons!

Or maybe it’s just because it’s so hard to configure to really draw a benefit from it?

@robcubbon, I’m not on a VPS so I don’t know how different the Apache + PHP configuration is under VPS systems. In any case, broadly speaking, here are my configurations:

Preview mode: off
Page Cache Method: Disk (enhanced)
Minify: enabled, with method: disk, default HTML minifier, JSMin, and default CSS minifier
Database Cache: Disk
Object Cache: Disk
CloudFlare active for some of my sites (the ones with most traffic)
No Varnish
Browser cache: enabled
No Debug settings

On the individual page configurations:

Page Cache
On General, the three first options are checked
The rest is default (Cache Preload is off)

On General:
Rewrite URL structure is OFF (this seems to get rid of the multiple 404’s when using Minify, which got on my nerves)
HTML minify settings: Enable
Inline CSS minification
Inline JS minification
JS minify settings: Enable
CSS minify settings: Enable
The rest by default

Database & Object Cache all left at default settings

Browser Cache… tricky, tricky, tricky!!!
On the General box, I have all 5 first options on. When I use CloudFlare on top of the site, Enable HTTP (gzip) compression seems to work fine. Without CloudFlare, it depends. On many cases, I can get gzip compression to work; sometimes I get problems with the CSS files like you reported. This was certainly the case with previous versions of W3 Total Cache, which did have a nasty bug when addressing CSS files with gzip compression! Version seems to have fixed that (well-known) bug.

This is pretty much my configuration, and it seems stable enough. Note that the “migration path” of W3 Total Cache is not always a rosy one; in several occasions I had to delete pretty much everything manually and install it again. The reason? Things like the Minify settings were attached to a specific theme; W3 Total Cache got often confused with other plugins that changed .htaccess and inserted their own URL rewriting code; multisite vs. single-site seemed to make W3 Total Cache unsure where to place the .htaccess rules for some sites, etc. Over the time, with each release, this process has become easier to deal with, but sometimes there is garbage spread all over the WP install, and my choice was to delete it all manually and start from scratch. When doing that, W3 Total Cache tends to work fine :slight_smile: (but, yes, it’s very likely the only plugin that sometimes requires some manual deleting after an upgrade; it’s a rather complex plugin, too, and hard to “get it right” the first time).

There are a lot of options I haven’t tried out yet, i.e. alternative Minify compilers, and placing some static content hosted on DreamHost’s “Files Forever” service. Also, at some point in time I’m sure I won’t resist and try out one of the popular CDNs to see if there is an improvement; for now, I’m happy with CloudFlare, which is free to use, and is for all purposes a CDN as well, although it works slightly differently from most (they require you to switch your DNS setup to them; it’s easy enough, and it can even read all the configuration directly from DH’s control panel, but I can imagine many people not being very happy with that). I surely am happy enough with CloudFlare and hope that DreamHost join their partner programme, and offer the service included from the control panel (much like they do it with Google Apps) — so vote for it :slight_smile:

It’s a big mess. I tried it on a dedicated server (not here, but it would be the same I expect), and I didn’t see enough speed improvement on my sites based on host-tracker.com. I cleaned up this nonsense (and when you uninstall, the modifications to the .htaccess file are not removed so they have to be deleted manually), installed WP-Super Cache, and got measurable speed boosts.


That’s quite interesting, Gene. I have exactly the reverse experience :slight_smile: W3 Total Cache gives me something around 4 times less page download time and it uses the browser cache far, far more efficiently (aye, I still use WP Super Cache on many of my low-traffic blogs). So I don’t rely on host-tracker.com exclusively; the power of W3 Total Cache is that it’s not just about the server-side, but also the way it integrates so neatly on the browser side. Most of the non-textual elements remain neatly on the browser and there is even no communication between the browser and Apache :slight_smile: (and, of course, the textual elements are completely static, so they load faster too):

On a dedicated server, there is a whole magnitude of further improvements that you can add! Just activating things like Advanced PHP Cache (APC) or Xcache will make your eyes water with the speed improvements. Go with ngnix instead of Apache, tweak it properly with all kinds of PHP accelerating tricks and tips, make sure that W3TC is happily interconnected with them, subscribe to CloudFlare, and you’ll get an old Pentium II with a few hundreds of MBytes at home outperform DH’s servers :slight_smile:

DH’s shared hosting setup is suboptimal for W3TC but it still makes a huge difference; I have no idea what host-tracker.com is actually measuring, but I’m pretty sure it can only measure what happens on the server-side of things. But it takes two to tango: it’s how things are improved on the browser side that will make things faster as well, too. I particularly like the way W3TC is very aggressive in compacting CSS, JS, and HTML, and optimizes the order things are sent back to the client; using Google’s Page Speed Report I can also see what the culprits are and fine-tune performance based on that — on W3TC, not necessarily on the theme itself.

Sure, it is a messy plugin to delete. It’s not “nonsense” in that regard; I prefer the word “messy” :slight_smile: And their creators warn in advance that it’s not a plugin for everybody; a badly-configured W3TC installation will be worse than having no caches set up…[hr]
Ok, hmm… I just did a test with host-tracker.com. Apparently the free service just tells “Response time”, which i don’t know what it means. Are you using the paid service, which provides a wealth of further information?

Because “response time” might mean different things. Is it the time of completion for the first request to the site? Then part of that time is just DNS.

Anyway, I tested on two blogs served from the same DH server. The first has a very complex theme with tons of external calls and functions (over 30 active plugins, most of which are contacting all sorts of services remotely), lots of Javascript, and so forth. With W3 Total Cache and CloudFlare, response time is on average 1.15 sec and bandwidth 285.41 Kbps.

The second test was made from a “test” blog which has little traffic, the Twenty Eleven theme, and few active plugins. It’s a very simple blog, so I just have WP Super Cache active on it — I never bothered to go through any pains of configuring W3TC on it. It has next-to-zero visitors. Average response time is 3.15 sec and bandwidth 8.78 Kbps (in this case, mostly because there is little to transfer except a few scattered images).

As a reference… I’ve got access to a virtual server which is fully-dedicated to a WordPress install. This allows me a lot of tweaking on the server side, way beyond what DreamHost allows, even though I have not the full range of options, and it’s not a dedicated server (although I believe that the remaining servers have little traffic, since most are not even public, but just used internally for the client). With way more configuration options than DH provides with their own Apache/PHP configuration, and with twice the traffic (on average) than my first example, with W3TC active I get an average of 0.59 sec and 30.41 Kbps (this site has a way simpler interface, but it’s not a “bare-bones” site, but a real, live site for a governmental institution, with plenty of images; it just has far less external functionality and a way cleaner theme).

While obviously I don’t know what host-tracker.com is actually measuring in the free service, it’s a bit pointless to reach some conclusions. What it looks like to me is that W3TC + CloudFlare gives me 3 times the performance (at least) than a very simple, unused blog hosted on DH using merely W3 Super Cache, which is consistent with my other tests; in fact, I get often more than “3 times the performance” because the browser cache makes so much difference.

Nothing beats a virtual/dedicated server with a simple theme, though. The main reason is that it can be optimised at will. If I wish further performance improvements on that client’s site hosted on a virtual server, I have way more options, all of them on “stand-by” if the traffic justifies the trouble:

  • Add CloudFlare (easiest to setup)
  • Add Squid and put it in front of Apache (Squid is faster serving static pages, and W3TC will make pretty much everything static anyway). Note that Squid has gazillions of fine-tuning options, so just that will allow a lot of extra performance improvements
  • Use Advanced PHP Cache instead of Xcache on PHP (allegedly it gives better performance; I’ve never tried it)
  • Dump Apache and use ngnix for ultrafast performance
  • Start tweaking the Linux kernel :slight_smile:

On a very heavy-traffic (old) server with hundreds of sites, a WordPress installation with W3TC, running inside a FreeBSD jail with Squid in front of it — a server that has been heavily optimised with all tricks of the trade — I get pretty much the same numbers as on the virtual server used to serve a single site: 0.51 sec and 21.61 Kbps (the blog has simple themes)

But if I don’t have the option to tweak the server — there is a limit to what one can do with DH’s shared hosting service — W3TC (and optionally CloudFlare) gives a reasonable compromise. Yes, it’s three times slower (assuming “response time” measures slowness…) than a dedicated solution (which, however, are far more expensive than three times the cost of DH’s shared hosting services…). But it’s also three times faster than using WP Super Cache. I understand that WP Hypercache gives better performance than WP Super Cache, but I haven’t tried it out. And, again, that’s not counting the user experience with W3TC’s aggressive use of browser caches; some pages load so quickly that it hurts the eyes watching them to render… and this cannot be measured easily by external measuring tools.

As I said, I’m using a dedicated server (not here), which has a dual quad-core Intel Xeon 5540 processor, 24GB RAM, 2TB storage, etc., etc. It’s a powerful beast.

My sites also display the page generation time and number of queries, using this command at the footer:

queries. <?php timer_stop(1); ?> seconds. —> The figure it presents in the source is .1 second faster, on average, with WP-Super Cache than W3TC. It appears host-tracker.com is measuring "HEAD,GET" performance at a number of sites around the world. I have the basic paid service there. Subjectively, on Safari and Firefox on a current-model Mac, with 55 megabit download broadband connection, it appeared faster with WP-Super Cache than W3TC. I have found Xcache to be buggy with WordPress, and, with all that CPU power, not a serious benefit with eAccelerator. By using suPHP as the handler instead of, say, DSO or FastCGI, I get better security too, as you probably know. That choice can't work with those cache accelerators. So I appreciate your observations, but if I can't feel it, perceive it, or measure it, it's all snake oil to me. Peace, Gene

@Gwyneth, sorry, after going through my emails with DH I actually found that they recommended I try other plugins after having heard about the problem I explained about in my first post in this thread. So, they didn’t say I shouldn’t use that plugin. My mistake.

I have several times tried to tweak here and there to make the site faster. But so far I haven’t had any major breakthroughs.

On Google Webmaster Tools I have: “On average, pages in your site take 6.5 seconds to load (updated on Jun 10, 2011). This is slower than 84% of sites.” - not good, I’m guessing!

I do have W3 Total Cache installed. I have PHP cache (x cache) installed on the server. This is a VPS with 600MB RAM.

I have installed the PHP footer plugin for WP - which puts JS calls in the footer.

Can we have gzip compression on the server? Or is it on already?

I would love to know if there’s anything I can do to speed the site up.

I am having memory problems with W3T but if you are using nginx, that would really reduce the memory load.