Yesterday I posted up a pretty lengthy introduction to W3TC, or better known as W3 Total Cache. You can check out Part 1 of the setup document here. In this post I hope to go into a bit more detail on how to get this setup for you all. I aim to give a little more customizations and more details behind what each thing does and why we need it.
Skip to the bottom to grab my config file if you don’t want to read this post!
Lets get to it. The first section we will tackle will be Page Cache.
We have the general section that should be setup like this:
- Checked – Don’t cache pages for logged in users
- Checked – Cache home page
- Checked – Cache feeds: site, categories, tags, comments
- Not Checked – Cache URIs with query string variables
- Checked – Cache 404 (not found) pages
Page Cache Settings – Advanced
There really is not need to touch any of these. Out of the box they are setup to help you if you choose to cache your page caches.
Page Cache Settings – Cache Preload
This allows you to serve up pre-cached pages to all visitors, even if a page has not been visited yet. It’s okay to leave this disabled, but if you run into performance problems when the preload activates, try lowering the number in the pages per interval setting.
- Checked – Automatically prime the page cache
- Update internal – 900, which is the default
- Pages per interval – 5, this is setup by default and really can be set as you see fit.
- Sitemap URL – Your blogs sitemap.xml URL wherever that may be, e.g. http://geekforhim.com/sitemap.xml
This is where the speed comes from. This is one of the harder parts to figure out if you are new to these types of settings. Look below to my standard config that you could import as stated in Part 1 of the setup document. I would recommend either my config file or at least figuring it out because this is essential to your sites speed increase.
Minify Settings – General
- Checked – Rewrite URL structure
- Checked – Automatically upload modified files – this is huge!!
Minify Settings – HTML
- Checked – Enable
- Not Checked – Minify Feeds – I don’t think this really accomplished much in terms of speed that you will notice
- Checked – Inline CSS minification
- Checked – Inline JS minification
- Checked – Line break removal
Minify Settings – CSS
- Checked – Yes you want to use this functionality!
- Not Checked – Combine only (unchecked)
- Checked – Comment Removal (checked)
- Checked - Line break removal (checked)
This portion is a little tricky and you may need a little help on this setup, if so, call someone who can help you out! Okay so what you need to know is the path to your actual CSS file(s). The easiest way to do this to pull up the source of your website. Right click on your website and select view source from the menu. Once there do a control F to find all files ending in .css.
Once found you will need to enter the path as such – wp-content/themes/nameofyourtheme/yourstyle.css – make sure to click verify URI. Once you click this button it should pull up your style.css to validate you have the correct path.
Do the above for all of your CSS files and you are set!
Minify Settings – Advanced Settings
Leave these alone as the default should be more than sufficient to start out this process.
I have used the defaults for the following sections – Database Cache and Object Cache
This allows access to your .htaccess file to allow for your visitors browsers to be sent certain commands that help your site come up faster for them.
Browser Cache – General / Default
- Checked – Set expires header
- Checked – Set cache control header
- Not Checked - Set entity tag (eTag)
- Checked – Set W3 Total Cache header
- Checked – Enable HTTP (gzip) compression
- Not Checked- Do not process 404 errors
The below sections I have left as default and really don’t need to fool around with the settings.
I have used the defaults for the Object Data Cache
CDN Configuration – this is where you setup your external settings and logins
- Configuration is ALL dependent upon which CDN service you choose as to what you need to fill out.
- Checked – Host wp-includes/ files
- Checked – Host theme files
- Checked – Host minified CSS and JS files
- Checked – Host custom files
- Not Checked – Force over-writing of existing files (although this is a good option if you continually update your site files)
- Not Checked – Import external media library attachments
CDN Advanced – This is left as default settings are more than adequate.
Well this is a pretty solid start to get you on your way to setting up a lightening fast server for your WordPresswebsite. Below I have attached my W3 Total Cache configuration file for those of you who want to skip all of the mubo jumbo and get things up and running fast. PLEASE check in on the CDN settings as I use them and you may not!!