How to Install and Setup W3 Total Cache Plugin for speeding up your website

How to Install and Setup W3 Total Cache Plugin for speeding up your website

Every WordPress user wants to know how to get their website to load fast. I would like to tell you that it is indeed very easy to achieve this. To speed up your WordPress website you should use cache plugin named W3 Total Cache, which caches every aspect of your website, and reduces its loading time.

Installing W3 Total Cache in WordPress

Before installing W3 Total Cache make sure to deactivate all other Cache Plugins. This will allow W3 Cache to work properly and gives you the best result. To install it, go to Plugins > Add New section in your dashboard. Search for W3 Total Cache and you should see it in the result. Finally click the Install Now button and then activate it.

Installing W3 Total Cache

Installing W3 Total Cache

W3 Total Cache Settings

W3 Total provides a number of Cache options and settings. We will discuss these settings one by one in our section below.

There is another plugin known as WP Super Cache which is also used to optimized your website speed by managing cache. You should also check this plugin too.

General Settings

After activating W3 Cache, go to Performance > General Settings to enable different cache options. These are Page Cache, Minify, Database Cache, Object Cache and Browser Cache.

W3 Total Cache General Settings

W3 Total Cache General Settings

Page Cache

In WordPress, a page/post/product is made up of Static and Dynamic parts. Static part comes from the WordPress Theme while Dynamic part (which mainly consists of title, description, user comments, sidebar data, etc) is stored in the database.

Whenever you visit a page, both Static and Dynamic parts of this page are fetched by the WordPress engine, which then sends them to your browser. Fetching Static part is very fast but the Dynamic part takes a bit longer time due to communication and data transfer from the database.

When you enable Page Cache for a page/post/product then both Static and Dynamic parts are combined to create a Static version. This Static version is stored by the WordPress in the Server. Whenever a user visits that page/post/product, WordPress simply sends this Static version to your browser. This significantly decreases page load time because there is no fetching of Dynamic part now.

Working of Page Cache

Working of Page Cache

You may remember enabling Page Cache option in the General Settings. Now go to Performance > Page Cache section, and here you can enable and set time for –

  • Pages whose Cache Copies are created.
  • Not caching pages for user roles.
  • Time interval before creating another set of cached pages copies.
  • Cookies and garbage removal time.
  • Purge Policy.

Recommended Settings
I recommend you to turn on the following Page Cache settings –

  • Cache front page
  • Cache feeds: site, categories, tags, comments
  • Cache SSL (https) requests
  • Don’t cache pages for logged in users
  • Preload the post cache upon publish events
There are many other options available in this section. It is recommended to use them wisely because if not done correctly they can increase your website’s load time.

Minify

It can be enabled from the General Settings area. Minify (Minification) means removing unnecessary characters from source code of the website. It makes source code smaller and improves performance. Go to Performance > Minify to do minification of HTML, CSS, JS and XML of your website’s source code.

You can even opt in or opt out certain CSS and JS file from minification.

Minify

Minify

Recommended Settings
I recommend you to turn on the following Minify settings –

  • Disable minify for logged in users
  • HTML minify settings
  • JS minify settings
  • CSS minify settings

Database Cache

In WordPress all data is stored in the database and this data is fetched with SQL queries. It is not effective to call the same query over and over again, on each page and for each visitor. The solution is Database Cache which saves the result of these queries and presents them when required.

Are your learning WordPress then check WordPress Theme Development tutorial that is made specially for you.

In this way SQL queries are not run and instead a static result is presented. This speeds up the website and also provides scalability, flexibility and availability.

database cache

Database Cache

You can set Database Cache options from Performance > Database Cache.

Recommended Settings
Turn on the following Database Cache settings –
1. Don’t cache queries for logged in users

Object Cache

Object Cache is quite similar to Database Cache, it caches both Database queries as well as non database objects. Go to Performance > Object Cache to set its options. When enabled, Object Cache caches data which is computationally expensive to regenerate. Data stored in the cache resides in memory only for the duration of time specified.

object cache

Object Cache

Browser Cache

Browser Cache stores all images, CSS, JavaScript and other static files in the user browser’s temporary folder. This way when the user revisits the site, the images, CSS and JavaScript are not downloaded from the website, instead are shown directly from the browser’s temporary folder. This greatly speeds up the website.

browser cache

Browser Cache

To set Browser Cache options, go to Performance > Browser Cache in your WordPress.

Recommended Settings
I recommend the following settings to turn on –

  • 1. Set Last-Modified header
  • 2. Set expires header
  • 3. Enable HTTP (gzip) compression

CDN

W3 Total Cache allows you to integrate your website with a CDN – Content Delivery Network. CDN serves your website static content from a network of Data Centers which reduces server load and speeds up your website.

W3 Total Cache supports many different types of CDN’s like MaxCDN, Akamai, Amazon CloudFront, AT&T and many more. Enable and select CDN Type from Performance > General Settings, then go to Performance > CDN to set up your selected CDN.

cdn setup in w3 total cache

CDN Setup in W3 Total Cache

If your CDN company is not given in W3 Cache then kindly disable CDN option and use your CDN separately. If you want to use CloudFlare CDN then visit What is CloudFlare and why to use it in your website, it will help you to install CloudFlare CDN.

I hope you found this article helpful in speeding your website up. If you have any questions, then feel free to ask in the comments below.

Share this article -

yogihosting

ABOUT THE AUTHOR

This article has been written by the Technical Staff of YogiHosting. Check out other articles on "WordPress, SEO, jQuery, HTML" and more.