Almost a month ago, I showed you guys a Step by Step Guide on How To Setup W3 Total Cache. W3 Total Cache 0.9 has been released and is a lot easier to configure. You don’t even have to hack into your .htaccess to enable stuff like browser caching anymore.
With some complaints about the last tutorial being heavy on images, I’ve decided to keep this based on text only.
Let’s begin
NOTE: These settings are for shared hosting with self hosted CDN ONLY. These are the exact settings, I’m using here on this blog.
UNDER GENERAL SETTINGS
Make sure to select the following options
- Deselect this option to disable all caching functionality.
- Page Cache and set page cache method to Disk Enhanced.
- Minify and set to Disk.
- Database Cache and set to Disk
- Object Cache and set to Disk
- Content Delivery Network and select Self-hosted/ File Transfer Protocol Upload
- Browser Cache
UNDER PAGE CACHE SETTINGS
Tick the following options
- Don’t cache pages for logged in users
- Cache the home page
- Cache site, categories, tags, comments and feeds
- Garbage collection interval: 7200seconds
- Rejected User Agents: Add the contents of this file there.
- Automatically prime the page cache: Update Interval = 900 seconds, Pages per interval = 10 & Sitemap URL = Link to your XML sitemap.
UNDER MINIFY SETTINGS
Select the following options
- Rewrite URL structure
- Automatically upload modified files
- Minify error notification: Disable
- HTML minify settings: Tick Enable, Inline CSS minification, Inline JS minification & Line break removal
- I didn’t enable JavaScript and Cascading Style Sheet options because I’m compressing these files using Minify URI Builder.
- Update external files every: 86400 seconds
- Garbage collection interval: 86400 seconds
- Rejected user agents: Add the contents of this file there.
UNDER DATABASE CACHE SETTINGS
Leave the default settings
UNDER OBJECT CACHE SETTINGS
Leave the default settings
UNDER BROWSER CACHE SETTINGS
I left the default settings. Everything remained ticked EXCEPT “Do not process 404 errors for static objects with WordPress“. I did this because it was conflicting with the permalink redirects I had set using Scott Yang’s Permalink Redirect plug-in.
UNDER CONTENT DELIVERY NETWORK SETTINGS
Nothing much has changed here so everything explained under this section in the first tutorial applies. Just make sure to tick Force over-writing of existing files.
UNDER USER AGENT GROUPS SETTINGS
I left the default settings
Well folks, that’s all there is installing and configuring the new version of W3 Total Cache
. In continuation are a few tips to help increase your PageSpeed and YSlow scores.
HOW TO SETUP A COOKIELESS CDN SUBDOMAIN
Disabling cookies on your CDN hosted files also contributes in it’s own little way to make your blog faster. Two common cookie setters are WordPress and Google Analytics.
Under wordpress, to set cookies for only your top level domain name, you must add the line below to your wp-config.php file
define(‘COOKIE_DOMAIN’, ‘www.yourwebsite.com’);
While you’re doing that, also check to make sure that your wp-config.php has the line below which is needed for ANY wordpress cache plug-in to work smoothly.
define(‘WP_CACHE’, true);
PLEASE REMEMBER TO BACKUP YOUR WP-CONFIG SHOULD SOMETHING GO WRONG!

To disable Google Analytics setting cookies for your subdomains, your Google Analytics tracking code has to undergo a minor adjustment. You have to set the “_setDomainName” value to your www domain. Like this:
<script type=”text/javascript”>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxxx-x']);
_gaq.push(['_setDomainName', 'www.yourwebsite.com']);
_gaq.push(['_trackPageview']);(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();</script>
That’s all folks. If I discover some more tricks, I’ll add the updates to the end of this page
.
This update was made possible by Serving Static Content from a Cookieless Domain, Speeding up ClassiPress and How to Configure W3 Total Cache to Work with WPtouch for WordPress.
W3 Total Cache has a whole different bag of tricks. It uses memcached, a memory-based cache, and as a result it appears to be much faster than WP-Super-Cache. The downside is that memcached isn’t available on most shared hosting providers. It’s not even usually installed on dedicated virtual servers, so you’ll need to follow a few instructions to get memcached up and running first.
That’s true. Memcached has to be manually configured and thus folks who ain’t good @ the technical stuff might not be able to get the best of it @ all. I don’t even think it’s enabled on any shared hosting plan @ all.
So does this mean that using total cache on shared hosting, is useless?
I don’t know where you got that impression but this blog and several others are running flawlessly on Hostgator Shared Web Hosting with W3 Total Cache enabled and properly configured on each and every one of them.
In summary W3TC works on shared hosting!
After doing the W3 Total Cache, configuration, I made a post on my blog, the image I try to attach did not come, I was not able to specify where the image would be because the that particular pop up did not come up, did I do something, wrong?
But, for speed, my blog is okay, now, thanks
Hmm! Funny enough I’ve never tried adding images to my blog posts from the admin area. In fact I don’t write posts via the admin area. I use Windows Live Writer ONLY. I’ll look into it and holla @ ya but then again, it might be your internet connection. Just keep trying it.
I just tested it here and it works just fine. Probably it’s a problem with your internet connection. All you need do is when you’re creating posts, click on add image and when the pop up comes up, select the image you want to attach then click upload. After that add the properties you want and then click insert into post.
W3 Total Cache automatically uploads that file to your CDN without hassles
If I deactivate this plugin to test, if it the problem and find out, it not, would still have to do this configuration again?
I tested another image and it was uploaded, but an image I have been trying to use is not loading, I changed from browser uploader to flash, I keep getting IO error.
I have definitely discovered my problem, the image I was trying to insert into the post was too heavy, about 1,90MB, I used paint and re-capture the image and brought it to 22.6kb, and it uploaded, I think the size was the problem, thanks for all the support, now ready to make the post on my blog!
You would most certainly continue to experience that error each time you try to upload a file larger than 2MB. Try increasing the allowed upload size. Hope this helps: http://wordpresstips.googlethem.com/how-to-increase-the-file-size-limit-on-uploads-with-wordpress/
Images have been uploaded but they are not coming up, I know I created a subdomain as cdn and when I tested ftp thing , I was hit with ftp passed, so what AM doing wrong?
From what I can see your cdn is set to cdn.15klaptops.com/ BUT your actual CDN is 15klaptops.15klaptops.com/
You need to go back to your CDN settings and make sure which of the above urls you’re using.
If you trust me enough, you can create an admin account for me so I can log-in and have a look @ your settings.
This information about setting up the cache looks fantastic. I’ll certainly be back to try it, but I’m not going to do it yet.
I started looking at this a few months ago, and installed the Page Speed software that Google recommends. I also installed YSlow, which is probably overkill. I started down the gzip and expiry dates recommendations, but when I looked at what I was trying to compress or cache, I was amazed.
My theme was including all sorts of junk that I never used, or did not need. Admin stuff was getting loaded with front-end pages, and all kinds of bloated js and css files were loading.
So I’ve taken a step backwards and started developing my own ultra slim theme. One of the quickest I could find is on my site now, but I’ve had to hack it quite severely to incorporate some theme essentials, so I’m developing my own.
Just by changing that theme, my load times were halved! My approach now is to get the page content as slim as possible, then fine tune that with the wise advice you’ve given here.
I found the best tool for this analysis is pingdom.com (click on the Tools menu). It’s particularly good because you can save and compare different settings to see which is best. One thing it clearly shows is the effects of any cacheing and expiration time settings, as you can use it twice quickly – the second test will be with pingdom using whatever it can from it’s local cache. It is also very good at showing dependencies, so a little fine tuning can often get some of the larger page components loading quicker.
I think you’ll be amazed by how much stuff is getting loaded that WordPress cache plugins will never see!
I’ve got too many articles on my list of things to do. I think I’ll let Chuks investigate pingdom, and I’ll try and finish the WordPress 3 upgrade review (World Cup and cricket ODI permitting
)
I’ve tried Pingdom on several occasions but it almost never completes the speed test. Right now I’m using and liking Web page performance test results. While you’re clearing your theme files, may I suggest you also look into your stylesheet file as believe me you, there could be a ton of stuff that your blog doesn’t use @ all. My stylesheet lost like 5KB after weeding
Site’s like yours with minimal images do well without cache plug-ins and cdn. Holla when you’re done with the WordPress 3 Upgrade review cos left, right and center all I see are complains from most folks who have upgraded
.
I just wanted to note that some of us are starting to be recommended to run the current dev version – which has a number of improvements going on. I was having trouble getting gzip to be recognized and moving to the dev version solved that. I also note a number of the lines very similar to what you have under HTTP Compression have been auto added for me by this new version, so it will be worthwhile to see if this post needs updated in the future. Thanks!
Kimberly
Thanks for the heads up. How do I get the development version? I’m still using Version 0.8.5.2
Bottom of this list of options on this page you will see “development version”
http://wordpress.org/extend/plugins/w3-total-cache/download/
Thanks for the link. I just downloaded it. Will test it on localhost to make sure it works fine before installing it on my blog.
I am trying to follow this to the ‘tee’. I am not tech savvy. I guess I am just frustrated because I don’t know. Thanks to your site, I am learning, step by step
I’m rapidly approaching my 100th WordPress 3.0 upgrade… most from 2.9.2, but some from as old as 2.8.4.. and a few from development builds such as 3.0-beta1.
Here’s a few things to know:
1. Headspace2 SEO plugin has compatibility issues and causes headaches.
2. Thesis needs a very minor patch to not temporarily lose access to the custom file editor.
3. Before upgrading be sure to move widgets to inactive (incase you’re a 2 side bar blog before you flip to the default theme), activate the default wordpress theme kubrick (or now twentyten), which deactivates the current theme which may be running SEO and advanced functions, deactivate all plugins (dont worry most settings are preserved)… and THEN upgrade.
4. Occasionally the database and all components upgrade but the upgrade does not “finish successfully” at which point the .maintenance file may be stuck – simply removing it via ftp usually solves that problem.
5. In the case of Buddypress blogs which have themes that depend on plugins, the plugins will have to be reactivated before the buddypress theme will not claim that it is “broken”.
All in all, this upgrade cycle has gone a LOT smoother than the 2.9 upgrade did, where 2.9 broke so much and 2.9.1 had to follow immediately.
Give me a shout if you need any help with this!
Kimberly
That was supposed to have been a reply to your reply to Keith above, but it didn’t thread right. Not sure why. Do you have threading only enabled to 2?
Kimberly
Strange. Threading is set to 5 and has worked fine prior to now. Funny enough I’ve had the same experience on another blog were I’m 100% sure, the blog admin had threading set @ 4. It’s probably just a random glitch.
Thanks for the help but I guess this steps of yours are for folks who update via WordPress Dashboard. I prefer using FTP since my internet connection ain’t fast enough and sometimes drops without a warning
.
Yeah probably a hiccup of some sort, I mean wordpress never ever gets gremlins LOL
You can still upgrade that way. Just deactivate that stuff from the dashboard first. Then go to FTP and do your manual upgrade. Then once you’ve upgraded go back to your dashboard and reactivate the stuff. No reason you can’t do it that way. I think I would personally put a .maintenance file in place before I started upgrading files, just in case my net DID drop during the transfer for more than a few seconds. Minimize the visitors that saw my site down.
I’m thinking of using the Maintenance plug-in when next I update. That way all visitors will see a site in maintenance notification when they visit until I’m done with the upgrade
Now about the CDN, is there a specific one to use. I am using a lot of images and videos and as you are aware of, been experiencing a bit of down time. I think adding a CDN would help with my blogs optimization, I just do not know where to look.
I haven’t really thought about hosting videos on my site and so I ain’t versed when it comes to CDN providers. Maybe this might help: Updated List Of Carriers, Telcos and Pure-Play Companies In The CDN Business.
Thanks, Rachael and Udeg, for the techie commentary. My head is starting to spin.
So, for the non-tech oriented crowd, would you recommend WP-Super-Cache instead of Total Cache?
I use HostGator if that makes any difference.
Thanks, Joe
This blog is also hosted with Hostgator. Both plug-ins work fine on their servers but I prefer W3 Total Cache ’cause it’s very COMPLETE
.
Hi,
Great sharing!
I have some questions if you don’t mind.
May I know if this plugin good for wordpress ecommerce site which has shopping cart and customers wish list?
I know from the developer of my wordpress theme that the shopping cart, customers’ wish list and check out pages need to stay dynamic.
Is there any extra setting I must do to accomodate the theme that I’m using?
Please advise.
Thanks,
May
Thanks for the compliments. With regards to wordpress ecommerce sites, I suggest you contact the author of W3 Total Cache via the WordPress Support site. In the meantime you coild check out WordPress eStore Troubleshooting
Cheers
.
Hey,
Can you tell me bit about Minify URI Builder ?
Ain’t nothing much to tell. It minifies your JavaScript and css files then combines them in one file for faster load times
. Remember to read You can check out this tutorial @ http://mrclay.org/index.php/2008/09/19/minify-21-on-mrclayorg/
Good job on the article. One thing I wanted to mention was your recommended settings for object and database cache. Caching db and objects to disk has the potential to slow down your site. It actually isn’t recommended by Frederick the plugin author.
The best bet is to do some testing to find the options that work the best for your site.
Thanks a lot for your advice and for dropping by. So far so good I haven’t seen any issues on my server with regards using object and database cache. I’ll be monitoring my server though for changes when there’s a spike in traffic. Thanks again man
BTW do you mind my copying your style @ Free WordPress Installation for my wordpress blog setup service? I’ll be reinventing it using Contact Form 7.
Wow, I have a a Hostgator VPS 3 account and your site loads faster than mine. I’m using Supercache right now, but might try W3 Total Cache. I’ve never seen anyone create a self-hosted CDN. Maybe you could write a post on how you setup the self-hosted CDN on a subdomain?
Here’s how to setup a self-hosted CDN: http://www.strictlyonlinebiz.com/blog/create-subdomain-cpanel/1341/. Do please keep in mind that site speed can also be affected by the amount of javascript and images your site uses and most especially how heavy these files weigh.
I don’t know is it me and some folks I asked to tell me their opinions on site loading, but aside test results from pingdom and webpagetest, the site seems to perform slower when w3TC is turned on.
Might be the shared host or the number of articles, and I tested various combination of settings. Will try your parameters a bit later… without the CDN part.
Does cookieless sub-domain takes less to load a file compared to no redirects and a cookie?
W3TC performance seems to vary across different hosts as their server setting might conflict with the plugin. I use Hostgator and so far so good, W3TC has been doing a wonderful job
Does cookieless sub-domain takes less to load a file compared to no redirects and a cookie? I’m not sure @ all.
Could be my optimization since I already done most of the things w3tc does, except DB/object caching, absolute minification and the server decides when to compress the content.
I’m not sure does it act the same for you since it prolongs the time needed to reach some page for the first time for 3-5 seconds… or it might be my host.
Should come handy in those days with spikes on some articles thou
It might take a few seconds to reach a page for the first time ’cause it’s trying to cache all the necessary javascript, images and stylesheets css so that subsequent page loads will be faster.
I’ve trying to install & set up this plugin as tutorial you post in this article. But there is an error :
Content Delivery Network Error: The “Replace default hostname with” field must be populated. Enter the hostname of your CDN provider. This is the hostname you would enter into your address bar in order to view objects in your browser.
What’s wrong with my setup?
Can you please send me a screen capture of the error to strictlyonlinebiz at gmail dot com? By the way what’s the name of your CDN?
I’ve been e-mail you about the screen shot
Thx
Have you ever seen total cache screwing with Facebook’s social plugin (recommendations, in particular) ability to pull thubmnails accurately. FB was getting them fine on my blog here http://www.dappledygrey.com (right sidebar) until I changed something and investigating seemed to hear some murmurings that it might be a Total cache issue.
I had the Recommendation plugin on this blog together with W3 Total Cache months ago and I didn’t notice any issues whatsoever. Maybe it’s a plugin conflict on your end. BTW I was using the code from facebook not a wordpress plugin
i want to delete this plugin as it has slowed down my site loading…
i deleted all the files and edited the config and .htaccess files as per said by the owner of the plugin.. but it still not helping me..
can you tell be what should i do to retain my websites old speed…???
I suggest you contact the plugin author himself as I have no knowledge regarding getting rid of w3 total cache
I have a strange problem with this w3 Total Cache. I am using a self-hosted CDN (subdomain) and this plugin seems to create new static folders inside the static folder. I am not sure why/when this is happening. I have checked the Force Over writing existing files but those new static folders still get created.
Any suggestion what I might have done wrong here?
I had the same issue with another wordpress blog hosted on a different server and in the end I had to stop using W3TC cdn funxtion for that blog.
I really don’t know what is causing it and I suggest you contact the plugin developer for some help.
Best wishes
Thanx fo your fast reply
I have a dedicated server, not shared, I will ask my host if they can do anything.
We have a grade A in YSLow but drops down to a C if not using CDN so I’ll see what we can find out with Host as CDN obviously is something we need. Without it the site load way too slow.
Thanx again for your help.
Best Regards
Monica
Thanks for replying. Please let me know if you manage to fix this issue.
Hi,
My programmer search high and low for a solution and he came over this Forum post that is answered by the developer:
http://wordpress.org/support/topic/plugin-w3-total-cache-infinite-of-folder-created-on-self-hosted-cdn
We installed this and so far no new static/ folders. Will let you know if this is not working.
Thanx again
Best Regards
Monica
Thanks. I’ll check that link out asap.
Hi,
I have that installed now and I have a pink box at the top now saying:
It appears Page Cache URL rewriting is not working. If using apache, verify that the server configuration allows .htaccess or if using nginx verify all configuration files are included in the configuration.
We’re using Apache and this was not a problem with that “normal” version.
Please let me know if you figure something out with that development version if you try it out.
Thanx
Monica
The last time I ever tried working with the development version, I ahs issues with it thus I restricted myself to using just the official version.
I’ll probably try it out on a dummy blog when I can and let you know how it goes
By the way could you please leave a message at that support page regarding this new issue to see if frederick has a solution for it?
Hi,
Sent a debug report to Frederick with the findings of the W3. Will update you when we hear back from him as this Development Version still add the extra static folders and seems like it dont always find minify files and CSS/JS files.
Monica
Even on my own installation, it’s pretty hard to get minification of css and js to work. The extra static folder problem has been around for a while and I think it’s an issue with server configuration, not the plugin per say
Frederick is debugging. Will let you know his findings when he is done.
Monica
Okay. Thanks
Hi,
Not heard back from Frederick, but one thing I did was NOT to host the favicon on the CDN and that stopped producing the extra “static” folders.
Getting a – in YSlow but not that big a deal.
Just wanted to let you know in case some of your readers have same issue.
Monica
Ooooops! I TOTALLY forgot that when I experienced that same issue on another server, the favicon.ico file was to blame. Thanks for the feedback. Frederick seems to hope that the new update will fix this issue.
BTW I sent you an email regarding a free ad spot. Didn’t you get it? Too bad ’cause the month is almost over
.
Hi,
Cant say I received that email from you, but I might have missed it
I dont see any new updates of the plugin yet but will ask my programmer to look into it.
Monica
Maybe the email landed in your spam folder. As soon an update for the plug-in is out, you’d get notification via the wordpress dashboard as is expected
Hi Again
Just dropping by to let you know that the I reinstalled the newest version of the W3 Plugin 0.9.2.1 and so far it has not duplicated the extra static folders.
Frederick has fixed a lot of errors that used to be on the old version and right now this new version works great for us
Best Regards
Monica
Nice. Now I can go back and add favicons to my clients sites
. Thanks for the heads up again.
I am having this issue with the current release, described here: http://wordpress.org/support/topic/w3tc-creating-thousands-of-redundant-directories?replies=3
Waiting on Frederick for help.
I had that same issue before and removing favicon.ico from the CDN fixed it.
Thanks for such a detailed explanation of it, I wasn’t expecting it but anyhow its really really helpful, thanks a lot for sharing it with us!
thanks for saving me the struggle, it will be so smooth
You’re welcome
Hi Udegbunam,
Thanks for providing this detailed and step-by-step instructions on how to install W3 Cache plugin. It sure is quite a handful and I do hope this works well in speeding up sites of different themes, etc.
It does help Felicia but of course it doesn’t take away from the fact that light themes are the best
Hi colud you help me please how to install Developer version ,
Installing the developer version ain’t different from installing the stable one.
Hi,
Its always good to see experts sharing their precious knowledge in no cost.Really nice post regarding cache speeds up wordpress.
Regards,
Sana
thanks you saved me lot of time.. actually my pagination plugin stopped working after enabling w3 total cache plugin, yous setting helped me in fixing that…
Cool man. Thanks for the feedback
It helps me a lot. Your guide is easy to understand. I will wait for your next post.:)
what if you do not use www in your url, will it matter as far as how accurate google analytics is?
I don’t think it matters at all as long as that is the url you need indexed
thanks, I am thinking about switching from Super Cache to W3 Total Cache.
All I can say to that W3TC rocks
Really gratefull Post For Me It Helps Me For Making My Blog Fast Thanks For This Heads Up.
i tried this but still getting error “Content Delivery Network Error: The “Replace default hostname with” field must be populated. Enter CDN provider hostname. (This is the hostname used in order to view objects in a browser.)” … what will be do? please help me…
What is the address of the CDN you are trying to use?
Your CDN address is what it’s asking for. Example cdn.onside.in
Hello Chuwudi,
This might sound dumb but where do i locate this code?
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxxx-x']);
_gaq.push(['_setDomainName', 'www.yourwebsite.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();
@Babanature: locate it where oh? In Google Analytics?