By default WordPress is a dynamic CMS (Content Management System). This means that for every visitor request that WordPress has to process, it must first connect to the database to see if the requested page even exists.
 
In a lot of cases this might not be problematic on a site that doesn't receive much traffic. However a sudden surge in traffic caused by search engine bots, or just a general increase in normal traffic can quickly cause your WordPress site to use up a lot of CPU resources from the server while trying to fulfill needless duplicate requests again and again.
 
You can counter this increase in CPU usage by implementing a caching plugin. What these do is cache the first visitor's request of a new page to a plain HTML file on the server, then when another visitor comes through and requests the same page, so long as the page wasn't updated in your administration section, or updated by a comment, the cached HTML page will be served.
 
This can greatly reduce CPU usage of your WordPress site very easily. As an example let's say you had 100 views of your front page, without caching that would require the same database query to have to run 100 times and every time it's just getting back the exact same data anyways.
 
With a caching plugin only the first user would have the database query run to generate the cached HTML file, then the next 99 visitors would get that cached HTML served to them right away, without having to wait for any database activity to complete.
 
This is just about always a win-win, because your visitors don't have to wait as long for your pages to load, and you're reducing the impact of WordPress's requests on the server's performance.
 
One of the simplest WordPress caching plugins to setup is WP Super Cache which is discussed in a previous article of ours.

However if you need more advanced caching options such as the ability to serve a static 404 error page the steps below will walk you through installing and configuring the W3 Total Cache plugin for WordPress.

**Note: This will not work with Wordpress Multisites.

  1. Hover over Plugins in the left-hand menu, then click Add New.
    plugins-add-new
  2. In the Search box, type in w3 total cache and click on Search Plugins.
    click-search-plugins
  3. Under W3 Total Cache click on Install Now.
    click-install-now
  4. Click OK in the installation pop-up.
    click-ok
  5. Click Activate Plugin.
    click-activate-this-plugin
  6. You should now see Plugin activated.
    plugin-activated
  7. From the left-hand menu, you should now have a new Performance section, hover over this and click on General Settings.
    performance-general-settings
  8. Scroll down the general settings page ensuring that each main section is enabled.

    These would be:

    Page Cache
    w3tc-setting-page-cache

    Minify
    w3tc-setting-minify

    NOTE: If you are using minify, make sure to enable the option, save it and then immediately look at your WordPress site to make sure that the site looks normal. If you see problems with formatting, then it's possible that a theme or plugin is causing issues due to the minification. You should then disable minification and not use this option with your website.


    Database Cache
    w3tc-setting-database-cache

    Object Cache
    w3tc-setting-object-cache

    Browser Cache, after enabling this option click on Save all settings
    w3tc-setting-browser-cache
  9. Hover over Performance again in the left-hand menu, and click on Page Cache.
    performance-page-cache
  10. Ensure that these options have a checkmark beside them, then click on Save all settings:

    Cache home page

    Cache feeds: site, categories, tags, comments

    Cache 404 (not found) pages

    Cache requests only for yourdomain.com hostname

    Don't cache pages for logged in users

    performance-page-cache-save-all
  11. Finally to confirm that you've setup everything correctly, in your web-browser open up your site and hit (Ctrl-U), or go to View -> Page source to view the source of the page. Scroll to the very bottom of the page and you should see the W3 Total Cache banner letting you know the page has been optimized.
    w3tc-confirm-page-source

Once you've confirmed that W3 Total Cache is up and running properly on your website you're done. Now you can enjoy quicker page loads, and reduced resource usage from your WordPress site! For more information on this course please visit Recommended Plugins.

Continued Education in Course 201: Recommended WordPress Plugins
You are viewing Section 7: Optimizing WordPress with W3 Total Cache plugin
Section 6: Optimizing WordPress with WP Super Cache Plugin
Section 8: Clearing cache in WordPress
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

2014-06-08 4:31 pm
i followed the above instructions exactly and my site display was radically changed to not acceptable viewing. called tech support and michael logged into backend and discover an error message in the dashboard... he went to Minify and unchecked "CSS minify settings:" so do NOT enable and my site went back to normal. can you guys check to see if okay and/or update your instructions. thank you!!! wp 3.9.1 - W3 Total Cache .0.9.4
2014-07-02 11:30 pm
a few days after doing the Minify, the site CSS still got whacked and made the site unreadable, so there's more going on here. but then a few days later the site went back to good with no modifications and been good for about 2.5 weeks now. i have no idea.
Staff
9,968 Points
2014-07-03 5:14 am
Hello Rockit,

Sometime CSS minification can cause problems and you might need to leave it disabled. It might be working now because the cache has cleared since enabling it.

If you continue to have issues, you might want to try to clear the WordPress cache and also clear your web-browser cache

Let us know if you have any further problems.

- Jacob
n/a Points
2014-10-18 9:23 am

Recently, I used w3 total cache but my site is acting wierdly, it is not properly loading and this happens on every page but when i referesh it loads properly.

I told my developer so he told me to empty the cache so it worked fine but it keeps happening like this. My developer advised that my internet speed is slow which is causing the page to stop loading. What possible solutions are there ?

 

Staff
19,427 Points
2014-10-20 11:26 am
Hello Arif,

The Internet speed would be from your end, not the server in the data center. However, there is a possibility that there is a routing error, causing slow loading. You may want to perform a ping and trace test to see if there are any hang ups in the route.

Kindest Regards,
Scott M
n/a Points
2014-06-25 12:53 am

I'm wary of installing this on a news website that currently has over 30 thousands posts. Will the process of caching this much content over burden my vps in media temple?

Staff
19,427 Points
2014-06-25 8:09 am
Hello dtigs,

Caching takes place as a page is initially visited not the entire site at once. It should not have an adverse affect on the server. In fact, overall (after caching) it should decrease your load, making your site more efficient.

Kindest Regards,
Scott M
n/a Points
2014-07-06 10:19 am

W3 Total Cache is very powerful but I get high CPU usage after doing page's purge

I need to purge page's for refreshing the new pages after getting new posts of my wordpress

Could you please to advise ? Thanks

Staff
9,968 Points
2014-07-06 4:29 pm
Hello Jage,

You shouldn't need to purge the entire cache when just updating one post in WordPress. Typically when you update a post, it will automatically update the cache for that post. Are you not seeing this behavior?

Make sure that you update the WordPress plugin so that you're using the latest version which has this functionality.

Please let us know if you're still having issues.

- Jacob
n/a Points
2014-10-20 8:14 pm

Yes, I still get the cpu high after purge pages

Yes, I see after updating a post, it will automatically update the cache for that post, but not the paging (1, 2, 3,...)

To re-arrange the paging  (1, 2, 3,...), page 1 is the newes post..etc, I have to purge pagesplease advise, my blog is batiks128.com

Staff
19,427 Points
2014-10-20 8:31 pm
Hello Jage,

There will be a surge if you clear or purge pages from caching. They need to recache in order to reduce the cpu usage. Is this what you are doing?

Kindest Regards,
Scott M
n/a Points
2014-07-15 2:03 am

I installed the W3 plugin and followed these W3 total cache settings but still my account shows high resource usage, what is the problem that I am facing. How do I get rid of high resource usage?

Staff
19,427 Points
2014-07-15 8:40 am
Hello Aditya

If you have installed the plugin and still report high usage you will need to contact live support so they can take a deeper look at the specifics of your account.

Kindest Regards,
Scott M
Staff
9,968 Points
2014-07-17 7:35 pm
Hello Aditya,

You can always take a look at the CPU graphs in cPanel to keep an eye on your account's resource usage.

It looks like you had a very large usage spike on 6/27, but since then your CPU usage has been within the limits for the most part.

I'd recommend also taking a look at our optimize WordPress guide for further tips on how to tweak WordPress to use the least amount of resources possible.

- Jacob
n/a Points
2014-07-22 12:06 am

cdncalc.com is a good website to compare CDNs. I've chosen keycdn.com and I'm very happy with it. 

n/a Points
2014-08-02 5:36 pm

I've followed many tutorial to install W3 Total Cache and have been having problems.  I've followed yours (great tutorial BTW) and my page source says it's optimized (although it has a ton of other script written below it) and currently I have over 700 broken links, 404s.  I disabled minify.  Is there anything else I check before I deactivate the plugin?

 

Thanks for your help!!

 

Jamie

Staff
19,427 Points
2014-08-04 10:23 am
Hello Jaime,

If the site was working prior to enabling a plugin, the first thing you should do is disable it to see if the normal behavior returns. If not, then you should check into the other things.

However, with that many broken links and 404's, it sounds as if your PermaLinks may have broken. To test this, go back into the admin area, disable the permalinks, save, and then re-enable them the way you had them. The site hopefully will return to normal behavior from there.

Kindest Regards,
Scott M
n/a Points
2014-08-04 5:10 pm

Thanks so much for your response, Scott!  I've disabled the plug-in and I still have those broken links.  I also have the Yoast SEO plugin.  Do I go into those settings and disable my permalinks, save then change it back to the way it was?  

Do I just change it to this:  /%postname%/

And do I change it under post titles?

Thanks for your help!!

Jamie

 

Staff
9,525 Points
2014-08-04 5:24 pm
Hello Jamie,

Thank you for contacting us. What Scott is suggesting is changing your Wordpress Permalinks to a different option. For example default, and saving.

Change the permalinks back to the one you were using originally, and save again. Then, test your site to see if it fixed your 404 errors.

If you are still having problems, I recommend reviewing our Common WordPress Troubleshooting guide. The first section goes over Disabling your WordPress Plugins.

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul
n/a Points
2014-10-08 10:25 am

Hi,

I am using wordpress along with cloudflare & cloudfront CDN, & also running W3 Total Cache plugin at www.eRescue.in, but GTMETRIX report at http://gtmetrix.com/reports/erescue.in/IY804vLS always give my website a F in "Specify a cache validator" section. I do not understand what i am doing wrong.

Staff
17,325 Points
2014-10-08 10:37 am
Hello Nikhil,

Thanks for the question. I researched this issue and I found this post that gives a variety of possible solutions to the issue. They also faced the same problem with the cache validation and provide you a solution.

Kindest regards,
Arnel C.
n/a Points
2014-10-08 10:46 am

Hi,

Thanks for your quick reply i did what you asked but it didnt help my page speed issue instead yslow jumped from 84 to 90, but still the cache vallidator issue persists.

http://gtmetrix.com/reports/erescue.in/bOzcjRS9

Staff
17,325 Points
2014-10-08 11:02 am
Hello Nikhil,

Did you clear your W3 cache? If you didn't then the old cache will still reflect the files made without the changes and be assessed by GtMetrix that way. If the problem persists, then you should contact Gtmetrix and ask what could be causing the flag if you have taken steps to resolve it. Also, if you, looked through the forum response, the last post mentions the same thing and provides a possible resolution to the issue.

Regards,
Arnel C.

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

24 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!