Nitro-Net.com – A Global Marketing Group Company
You read that title right.
This post is about a specific WordPress plugin that every blogger should have under their toolbelt.
I’m talking about W3 Total Cache — an all-in-one website optimization plugin.
If you use WordPress, read on to find out how to use W3 Total Cache to supercharge your website’s performance.
Table Of Contents
- 1. Introduction
- 2. Optimizing Your General Settings
- 3. W3 Total Cache Optimal Settings: Page Caching
- 4. Optimizing Minify Settings
- 5. Optimizing Database Cache
- 6. Optimizing Object Cache
- 7. Optimizing Browser Cache
- 8. Optimizing User Agent, Referrer, and Cookie Groups
- 9. Optimizing Fragment Cache
- 10. Using Extensions for Scalability
- 11. Conclusion
Allow me to start by introducing the plugin of the hour.
What is W3 Total Cache?
As a blogger, increasing your website’s performance should be a top priority.
Not only will it considerably improve the user experience, it’ll also help you attain higher search engine rankings.
W3 Total Cache makes website performance optimization a walk in the park. It has all the features you will ever need for the majority of factors that affect loading speed.
Just like every other WordPress plugin out there, installing W3 Total Cache is the first step.
You can view the plugin’s overview page by clicking ‘Performance’ from the main menu and clicking ‘Dashboard.’
This should give you a good look at some of the plugin’s key features. You can also perform quick actions like a WordPress compatibility check and cache emptying.
Of course, the W3 Total Cache dashboard page is only the beginning.
Why don’t we take a closer look under the hood?
Optimizing Your General Settings
Like most WordPress bloggers, the “General Settings” page is probably the first section you’ll check.
Luckily, that’s also where W3 Total Cache’s core features can be enabled, namely:
1. Choosing the Right Page Cache Setting for Your Website
Before we go any further, page caching — along with a lot of W3 Total Cache’s features — are already explained in this post. Doing so should give you a more detailed explanation of all strategies that will be mentioned later on.
Now that we got that out of the way, page caching can be enabled with W3 Total Cache in literally two clicks.
Just select the ‘Enable’ checkbox under the “Page Cache” section and click ‘Save all settings.’
Website caching works by enabling browsers to temporarily save your website’s data. This allows them to instantly fetch your content on the user’s next visit.
What about the other settings?
The beauty of using W3 Total Cache is that most features should work well right out of the box. However, there are W3 Total Cache optimal settings to be mindful of.
If your site currently runs on a shared host, choose ‘Disk: Enhanced’ as your page cache method.
‘Opcode’ caching, however, must be selected if you upgrade to a dedicated server. For those who use cloud hosting, then ‘Memcached’ should be your page cache method.
2. Minifying Your Code for Lower Bandwidth Usage
Code minification is another W3 Total Cache feature that could give your website’s performance an easy boost.
The larger these bits of codes are, the more bandwidth they need to be transferred.
In turn, this increases the overall loading time of your page.
How to do minification the old-school way
With minification, unnecessary code elements like comments, whitespaces, and line breaks are stripped removed.
Want to do it manually?
Sure, if you’re prepared to stare in front of your computer for days or even weeks on end.
Instead, use a tool like Minify Code to automatically minify any code you upload.
If that’s not easy enough for you, W3 Total Cache can minify your codes in a snap.
Doing it with W3 Total Cache
On the “Minify” section, tick the ‘Enable’ checkbox and save your changes. As for the rest of the settings, you can leave them to their default values.
Minification through W3 Total Cache, however, can be disabled if you use Cloudflare. It’s a web optimization and security services company that implements code minification on your behalf.
If you’re interested in Cloudflare, I’m pleased to tell you that they do offer a free solution.
This lets you take advantage of a global CDN, basic DDoS protection, and a free SSL certificate.
3. Using Other Site Caching Methods
Apart from the basic page cache mentioned above, you can also modify various caching options on the general settings page. This includes database caching, Opcode caching, object caching, and browser caching.
These caching options can be found directly below the minify section.
Below are the specific ways to use each caching option:
- Opcode Cache — Opcode caching works by reducing PHP code blocks on your website. It’s only available if you have W3 Total Cache Pro.
- Database Cache — If you use virtual hosting or a Content Delivery Network, it’s best to leave database caching disabled. You may also want to test your website’s speed after enabling this option to see whether or not it helps.
- Object Cache — While it may slow down your WordPress admin area, object caching is recommended for dynamic websites. These are sites that let users change or add content, such as forum posts, shopping carts, and other customizable elements.
- Browser Cache —Out of all the caching options, browser caching is the one you should enable no matter what. It utilizes the resources of your visitors’ computers, so it won’t negatively affect your site under normal circumstances.
4. Updating Your CDN Settings
Following the additional caching settings is the “CDN” section.
In simple terms, a CDN works by leveraging a network of proxy servers distributed across multiple regions. Latency is then significantly reduced by letting users download your website’s data from the nearest server.
To a degree, CDNs also offer protection against DDoS or Distributed Denial of Service attacks.
So…does that mean W3 Total Cache will give me a CDN?
Unfortunately, enabling the CDN option on W3 Total Cache doesn’t mean you’ll automatically receive these benefits.
The thing is, a CDN can only be utilized with the help of third-party providers. Apart from Cloudflare, other examples of companies that offer CDN services are:
You can view more options by reading this list of free CDN services for WordPress blogs.
If you use a CDN, then you should click ‘Enable’ on W3 Total Cache’s general settings page.
You then have to choose the appropriate “CDN Type” from the drop-down menu to match your CDN provider.
What’s that — you can’t find your CDN from the list?
Thanks to the popularity of W3 Total Cache, your CDN provider can most likely assist you in the configuration process.
Cloudflare users, for example, need to use the official extension in order to use W3 Total Cache with their CDN.
For other CDN service providers, the “Generic Mirror” option will most likely be used.
In any case, additional setup is necessary when setting up your CDN with W3 Total Cache. We will explore this process later with a little more detail.
5. Understanding Extra Settings
One of the reasons why W3 Total Cache is so popular is its comprehensiveness.
In addition to the settings outlined above, it also has advanced tools that take performance optimization to the next level.
Granted, the majority of WordPress users don’t need to play with these features.
But in case you do, then let me gloss over those features real quick.
Right after the CDN section, you’ll find “Reverse Proxy.”
This is a feature that refreshes the Varnish cache whenever site content is updated.
If these terms are unfamiliar to you, chances are you don’t need to use them yet.
Varnish Cache is an application accelerator that mainly used by large sites and APIs. Once installed on your server, it independently performs caching for your website’s content for massive speed boosts.
W3 Total Cache’s reverse proxy settings let you specify your Varnish IP addresses. You then have to click ‘Save all settings’ for your changes to take effect.
To put things in perspective, Varnish is used by very large websites like Reddit, Wikipedia,and Stack Overflow.
Unless you get as much traffic as these sites, I wouldn’t worry about Varnish or reverse proxy settings for now.
Similar to reverse proxy, the “Monitoring” section is another feature that most W3 Total Cache users ignore.
Basically, it lets you monitor the performance of your site or web application through New Relic — a software analytics service.
If you use New Relic, then you need to configure your API key here.
For websites that use dynamic blocks of PHP code, then fragment caching should give your website a noticeable speed improvement.
As effective as fragment caching is, there are two downsides to this feature.
First, implementing it can be tricky.
The “Fragment Cache” section of W3 Total Cache’s general settings page will help with the first step of deployment.
After you select a fragment cache method, you also have to define “fragment groups” for your PHP codes. This is a task for a developer, but if you want to learn, start with this page from W3 Edge.
Aside from the complicated configuration process, fragment caching also requires you to purchase W3 Total Cache Pro.
This takes us to the next feature you should know about.
If you have upgraded to W3 Total Cache Pro, you can enter your key on the “Licensing” section. When done, click ‘Verify license key’ to activate your copy for your current WordPress installation.
That reminds me, we haven’t talked about the benefits of W3 Total Cache Pro yet.
We’ve already covered fragment caching, which is one of the four selling points of W3 Total Cache Pro:
W3 Total Cache’s flexibility is in full display with the “Miscellaneous” section on the general settings page.
At the very top is the ‘Enable Google Page Speed Dashboard Widget’ option.
When properly configured, this will present data from your website’s PageSpeed Insights report on your WordPress dashboard. You simply need to select the checkbox and enter your PageSpeed API key.
Using PageSpeed Insights is a go-to method of measuring a website’s performance.
With the feature above, it’s easier to tweak W3 Total Cache since your speed score is updated in real time.
If you don’t know where to get your PageSpeed Insights API key, refer to this documentation from Google.
With PageSpeed Insights integrated, you may also enable the ‘Show page rating in admin bar’ option. This will make your website’s speed score immediately visible on your WordPress dashboard.
Below the settings related to PageSpeed Insights is the ‘Verify rewrite rules’ option.
As the description implies, it will alert you whenever your rewrite rules have issues in your .htaccess file.
Enabling this option will not have any side effects on your website’s performance, so it’s best to leave it on. This will help you maintain the integrity of your website’s code.
Moving on, the ‘Enable file locking’ option prevents multiple users or processes to access the same file simultaneously.
W3 Total Cache recommends keeping this option disabled for NFS systems along with websites running on shared hosting.
Perhaps the only scenario where file locking is useful is on very busy sites where access conflicts are plausible. Even then, it may not result in any perceptible performance gains.
Speaking of tentative performance optimization features, the next option also doesn’t guarantee improved loading speed. Interestingly, it has the exact opposite use case as file locking.
If your web host is NFS-based, consider enabling ‘Optimize disk enhanced page and minify disk caching for NFS.’ This could lead to a decent increase in website performance, but you’ll have to see for yourself if it works.
Lastly, the last two miscellaneous settings have nothing to do with website performance improvement.
With ‘Anonymously track usage to improve product quality’ enabled, you grant W3 Total Cache to track your plugin usage. Useful if you care about the plugin’s development, but plenty of bloggers would prefer this to be off.
‘Enable caching statistics,’ on the other hand, can be helpful if you’re into fine-tuning W3 Total Cache over time.
6. Debugging Settings
If you plan to use caching statistics, it makes sense for you to use debugging settings as well.
Debug modes will generate in-depth information about certain caches when enabled. To use them, tick the checkbox of the mode you want to activate.
The catch is, enabling any debug mode may result in less-than-ideal performance. That’s because your site has to put in extra work to track W3 Total Cache features.
That said, debugging should be done on a short-term basis and disabled once you’ve worked out all the issues.
7. Importing and Exporting W3 Total Cache Configurations
W3 Total Cache is often seen as a plug-and-play solution that takes little to no setup.
With what you’ve read so far, can you still say the same thing?
In fact, configuring W3 Total Cache may take hours if you want it tailored to your site’s needs.
That’s why W3 Total Cache allows you to export and import plugin configuration settings.
To import plugin configuration from an outside source, click ‘Choose File,’ find the HTML or .json document, and click ‘Upload.’ Believe it or not, there are actually WordPress blogs out there that allow you to download their plugin configuration.
If you need to export your plugin settings as a backup, simply click ‘Download’ next to “Export configuration.”
Accidentally messed up your WordPress site by importing a configuration file?
Don’t worry — you can always revert the plugin back to default settings with one click.
Just click ‘Restore Default Settings’ and you’re golden.
W3 Total Cache Optimal Settings: Page Caching
When you’re done with the general settings of W3 Total Cache, it’s time for the advanced page caching options.
We still have a lot of ground to cover, so let’s just get on with the recommended settings for maximum website performance.
A word of advice: you will encounter a lot of technical terms for the rest of this post. That said, try to keep a separate tab open so you can search for their definitions.
But for your convenience, I listed down the optimum configuration for most WordPress blogs. All that’s left to do is copy these settings and apply it on W3 Total Cache.
Ready? The click on ‘Page Cache’ from the “Performance” sub-menu to get started.
8. Selecting the Right General Options
For page caching, below are the optimal W3 Total Cache settings you should use on your WordPress site:
- Cache posts page — Enable.
- Don’t cache front page — Disable.
- Cache feeds:site, categories, tags, comments — Enable.
- Cache SSL (HTTPS) requests — Enable if you use an SSL certificate.
- Cache URIs with query string variables — Enable unless the checkbox is greyed out.
- Cache 404 (not found) pages —Disable.
- Don’t cache pages for logged in users — Enable.
- Don’t cache pages for the following user roles — Enable as long as you select all user roles.
9. Configuring Aliases
If you don’t even know what aliases are, then don’t touch anything under the “Aliases” section.
In the world of web hosting, an alias is a separate domain that points to the same WordPress installation. This is something that one-man bloggers rarely do, so feel free to ignore this section.
Otherwise, you should already know what to do next:
10. Utilizing Cache Preloading
While regular caching improves the experience of returning traffic, cache preloading benefits everyone.
Yes — that includes first-time visitors.
Here are the best settings for cache preloading:
- Automatically prime the page cache — Enable.
- Update interval — 900 seconds.
- Pages per interval — 10 pages.
- Sitemap URL — Just paste the URL of your sitemap. Learn more about sitemaps by reading this post.
- Preload the post cache upon publish events — Enable.
11. Setting Your Cache Purging Policy
Purging caches makes sure users can view the latest changes on your website.
By setting a purge policy, you put this process on autopilot whenever any of the following occurs:
- You create a new post
- You edit an existing post
- A user posts a comment
To create a purge policy that won’t affect your website’s performance, use the following settings:
- Pages to cache — Front page, posts page, post page, and blog feed.
- Specify the feed types to purge — Rss2 (default).
- Purge limit — 15 or more if you have a higher-end server.
- Additional pages — Blank.
- Purge sitemaps — Keep the default regular expression value.
12. Managing the REST API
If you have W3 Total Cache Pro and use RESTful API, you may benefit from the REST API caching tool.
Let me guess — you are nowhere near doing anything of that magnitude.
In which case, it’s best to leave the REST API caching with the default setting: ‘Don’t cache.’
13. Advanced Page Cache Settings
W3 Total Cache has a long list of advanced settings for page caching.
Naturally, there are a plethora of ways to configure these settings based on your website’s requirements. But for most bloggers, the settings below should ensure a loading speed improvement.
- Late initialization — Disable.
- Late caching — Disable.
- Compatibility mode — Disable unless you’re getting caching errors.
- Charset — Disable unless you find unusual characters in your page cache.
- Reject HEAD requests — Leave to default.
- Garbage collection interval — 3,600 seconds if caching to disk (otherwise, this option will be greyed out).
- Comment cookie lifetime — 1,800 seconds
- Accepted query strings — Blank.
- Rejected user agents — Blank.
- Rejected cookies — wptouch_switch_toggle(default).
- Never cache the following pages — wp-.*.phpand index.php(default.)
- Never cache pages associated with these categories — Blank.
- Never cache pages that use these tags — Blank.
- Never cache pages by these authors — Blank.
- Never cache pages that use these custom fields — Blank.
- Cache exception list — Add pages that have issues with caching.
- Non-trailing slash pages — Keep the default pages.
- Specify page headers — Keep the default settings.
- Handle XML mime type — Enable.
Optimizing Minify Settings
Again, if you use Cloudflare, there’s no need to modify the W3 Total Cache code minification settings.
On the ‘Minify’ page, you can control how code minification is handled on your WordPress website.
Here is a breakdown of each section on the minify configuration page:
14. General Settings
When it comes to minification, you don’t need to make any changes in the general settings. But that doesn’t mean we shouldn’t review the ideal code minification settings of W3 Total Cache.
- Rewrite URL structure — Enable.
- Disable minify for logged in users — Leave to default.
- Minify error notification — Disable.
15. HTML & XML Minification
- HTML minify settings — Enable with inline CSS and inline JS minification.
- Ignore comment stems — Keep default values.
16. JS Minification Settings
- JS minify settings — Enable while choosing “Minify” over “Combine only.”
- Operations in areas (Before) — Non-blocking using “defer.”
- Operations in areas (After) — Non-blocking using “defer.”
- Preserved comment removal — Enable.
- Line break removal — Enable.
- HTTP/2 push — Enable except if you use the “Disk: Enhanced” method with Nginx.
17. CSS Minification Settings
There are, however, a couple of additional settings to enable if you want a fluid website.
- CSS minify settings — Enable with “Combine only” selected.
- @import handling — None.
- HTTP/2 Push — Enable.
18. Advanced Minification Settings
As icing on the cake, use the options below on the “Advanced” section.
- Update external files every — 86,400 seconds (24 hours).
- Garbage collection interval — 86,400 seconds (24 hours).
- Never minify the following pages — Leave empty.
- Never minify the following JS files — Temporarily add codes you are currently working on to preserve comments and readability.
- Never minify the following CSS files — Same as above.
- Rejected user agents — Leave empty.
- Include external files/libraries — Add URLs of external resources like Google Fonts and the Google Tag Manager. Just be sure to test your changes.
Optimizing Database Cache
Your website consists of a lot of parts that must be fetched and loaded whenever they’re needed.
Database caching can augment this process by making resources for common queries readily available. This reduces the CPU load of serving website data to users.
Here’s the first thing you should do. If you’re not using a CDN or a virtual host, enable ‘Don’t cache queries for logged in users.’
19. Advanced Database Caching Settings
For the advanced settings, here’s what you should do:
- Maximum lifetime of cached objects — 180 seconds for high-traffic sites, up to 7,200 seconds for low-traffic sites.
- Garbage collection interval — Anywhere between 3,600 and 86,400 seconds (if the option is not greyed out).
- Never cache the following pages — Leave empty.
- Ignored query stems — Leave the default values or add “wc-session” if you use WooCommerce.
- Reject query words — Leave to default.
- Reject constants — Leave to default.
Optimizing Object Cache
Object caching is another way to reduce the CPU usage of loading your website.
Don’t be surprised if your admin area slows down with this feature turned on. It’s actually a reasonable trade-off if you value the experience of your users.
20. Advanced Object Caching Settings
Dynamic websites live by database and object caching to stay fast and responsive. You just need to apply these optimal settings:
- Default lifetime of cache objects — Like database caching, this should be 180 seconds for high-traffic sites and up to 7,200 seconds for low-traffic sites.
- Garbage collection interval — 3,600 seconds.
- Global groups — Leave to default.
- Non-persistent groups — Leave to default.
- Enable caching for wp-admin requests — Enable this to speed up your WordPress admin panel, but disable if you get outdated, cached data.
- Store transients in database — Enable.
Optimizing Browser Cache
Though database and object caching are both optional, browser caching should be enabled for every WordPress site.
It enables web browsers to store static website files like images, text, and codes for instant retrieval.
Like code minification, browser caching also has an extensive list of options.
Below is a rundown of each section:
21. General Settings
As a rule of thumb, enable the first six options on the “General” section of the browser cache configuration page:
- Set Last-Modified header
- Set expires header
- Set cache control header
- Set entity tag
- Set W3 Total Cache header
- Enable HTTP (gzip) compression
Want to know something fun?
Most of these are browser caching functions that you can test on GTmetrix — a free website performance analysis tool.
You can use GTmetrix while you configure W3 Total Cache to verify certain caching features. For the ones listed above, they should appear on the ‘YSlow’ tab of the analysis report.
Beyond the first six options, there are other things you should manage on the browser caching configuration page:
- Enable HTTP (brotli) compression — Enable this option if available and test if it outperforms gzip compression.
- Prevent caching of objects after settings change — Enable.
- Remove query strings from static resources — Enable.
- Prevent caching exception list — Leave empty.
- Don’t set cookies for static files — Enable.
- Do not process 404 errors for static objects with WordPress — Disable.
- 404 error exception list — Leave to default.
- Rewrite URL structure of objects — Disable.
22. CSS & JS, HTML & XML, Browser Caching Settings
To keep your WordPress website in tip-top shape, it’s advised to leave these settings as they are.
Just a reminder: the settings for CSS & JS, HTML & XML, and Media & Other Files are somewhat similar. Since there’s no reason for them to have different configurations, use the following settings where they apply:
- Set Last-Modified header — Enable.
- Set expires header — Enable.
- Expires header lifetime — 3,600 seconds for HTML & XML, 31,536,000 seconds (one year) for the other two.
- Set cache control header — Enable.
- Cache control policy — Leave to default (cache with max-age).
- Set entity title tag — Enable.
- Set W3 Total Cache header — Enable.
- Enable HTTP (gzip) compression — Enable.
- Enable HTTP (brotli) compression — Same as before.
- Prevent caching of objects after settings change — Enable.
- Remove query strings from static resources — Enable.
- Disable cookies for static files — Enable.
23. What to Do with Security Headers
By now, you should already know that there are certain settings in W3 Total Cache that must be left alone.
Security headers are among those settings.
The options you’ll find here are reserved for users who are well-versed in web development and security. You can modify your site’s HTTP Strict Transport Security policy directive, enable X-XSS-Protection, and more.
If you these terms are new to you, leave everything under security headers to their default values.
Optimizing User Agent, Referrer, and Cookie Groups
In W3 Total Cache, the “group” configuration pages must also be ignored by most non-developer, WordPress users.
This includes ‘User Agent Groups,’ ‘Referrer Groups,’ and ‘Cookie Groups.’
There are, however, a number of use cases for some group types that may affect user experience.
24. User Agent Groups for Personalization
If you’re an advanced WordPress user, user agent groups can be used to redirect certain traffic to a different domain. You could even force their browser to load a different theme on your WordPress site.
Suppose you created a group for all your mobile users.
With user agent groups, you can redirect them to a separate mobile version of your site. If not, you may tell their browser to launch your site with a more mobile-friendly theme.
Just proceed with caution and remember to test your configuration to avoid breaking your site.
Optimizing CDN Settings
Feel like you’ve been doing all the work?
Then I have some good news for you.
If you decide to use a CDN, your service provider should be willing to help with W3 Total Cache’s configuration.
In other words, you can safely ignore all these settings and wait for your CDN vendor’s assistance.
If you are experiencing problems with your CDN on SSL pages, then it’s only fair to tell you a workaround.
25. How to Disable CDN on SSL Pages
Under the “Advanced” settings section, select ‘Disable CDN on SSL pages.’ Affected pages should now load normally while you seek assistance from your CDN provider.
Optimizing Fragment Cache
The “Fragment Cache” settings page is another area of W3 Total Cache that you should skip.
This is especially true if you don’t have the Pro version of the plugin.
26. Configuring the Fragment Caching Feature
If you paid for the plugin and would like to use fragment caching, below are things you ought to remember:
- Registered fragment groups — If you are trying to define fragment groups for W3 Total Cache, they should appear here.
- Default lifetime of cached fragments — The default value is 180 seconds, but it can be increased if you have low traffic.
- Garbage collection interval — Keep this at 3,600 seconds (default) if you have a high-traffic site.
- Manual fragment groups — Manually enter fragment groups here — don’t touch if you don’t know what you’re doing!
Using Extensions for Scalability
Finally, you should know that W3 Total Cache comes with a number of pre-installed extensions.
WordPress users should be right at home on the “Extensions” page. Without the W3 Total Cache logo, it looks like a carbon copy of the “Plugins” page on the dashboard.
This means activating and deactivating extensions involves a familiar process. You either click the buttons at the bottom of each extension or perform “bulk actions” using the drop-down menu.
Since there’s no perfect way to run your W3 Total Cache ecosystem, I’ll let you determine which extensions to activate.
27. Three Important W3 Total Cache Extensions for WordPress Websites
Below are some of the most useful W3 Total Cache extensions and what they do:
- AMP — The AMP or Accelerated Mobile Pages project helps website owners achieve buttery smooth loading speeds on mobile. Enabling this extension will add AMP support to W3 Total Cache’s minify features.
- Yoast SEO — If you rely on Yoast SEO for on-page optimization, activate this extension for the seamless integration of W3 Total Cache.
- Genesis Framework by StudioPress — A lot of WordPress users leverage the Genesis Framework to construct SEO-friendly websites from scratch. If you belong to this group of users, enable this extension for a performance improvement of 30 to 60 percent.
Here’s a final piece of advice: if you want to activate extensions, do so one at a time.
Just like plugins, extensions may cause unexpected issues on your website when active. By enabling one extension at a time, you can easily pinpoint the cause of potential issues.
Configuring W3 Total Cache for optimal website performance may take some time.
Don’t rush — you can always bookmark and refer to this page whenever you need to.
Remember to test your website’s speed as you incrementally make adjustments. While you’re at it, export your configuration as a backup in case you need to re-apply these settings.
Tell me about your experience with W3 Total Cache in the comments below!
You Might Also Like:
- 19 Easy Ways to Reduce Bounce Rate on Your Blog and Maximize Your Traffic
- Everything About WordPress Plugins
- 10 Best Social Sharing WordPress Plugins for Bloggers
The post Supercharge Your Website’s Speed: 27 Steps for W3 Total Cache Optimal Settings appeared first on Master Blogging.