How Do I Setup W3 Total Cache In WordPress 2019?

Reading Time: 8 minutes

Do You Need W3TC?

The short answer is an overwhelming Yes!

W3 Total Cache is currently the best WordPress plugin for cache-based, performance optimization. W3 Total Cache improves the overall speed of your site by caching multiple elements on your pages which improves the overall responsiveness of your webserver.

What is Caching?

Caching is simply the storage of website data for later usage by your clients. Caching can be accomplished via multiple methods, with W3TC (W3 Total Cache) being one of the primary means to achieve this task. W3 Total Cache is rated as one of the best WordPress plugins for performance optimization on Virtual, Dedicated and Managed servers and, is used by millions of sites to increase their overall site performance. 

The W3TC plugin site itself lists multiple other benefits of this software as well, and I quote: 

*Improvements in search engine result page rankings, especially for mobile-friendly websites and sites that use SSL

*At least 10x improvement in overall site performance (Grade A in WebPagetest or significant Google Page Speed improvements) when fully configured

*Improved conversion rates and “site performance” which affect your site’s rank on Google.com

*“Instant” repeat page views: browser caching

*Optimized progressive render: pages start rendering quickly and can be interacted with more quickly

*Reduced page load time: increased visitor time on site; visitors view more pages

*Improved web server performance; sustain high traffic periods

*Up to 80% bandwidth savings via minify and HTTP compression of HTML, CSS, JavaScript and feeds

https://lqwb.us/30Bgh2y (W3TC is typically not for use on shared servers)

Prerequisites

Before you start the install process, we suggest that you document the performance of your sites before installing W3TC. To verify the website speed increases, you can use websites like Google’s Page Speed, StatusCakeDareboost, Pingdom, or GTMetrix to get a better overall perspective of the before and after benefits of W3TC.

Also, we suggest deactivating and uninstalling other caching plugins you may have used before installation, as other caching plugins changes may have a negative effect on W3TC. Other plugins will usually have some customizations in place that have modified the rewrite rules for fancy permalinks, or they possibly may have modified your browser caching rules. We only mention this as W3TC will automate the management of all caching best practices. Also please ensure the wp-content/ and wp-content/uploads/ folders have a temporary 777 permissions set before moving forward. You can make this change in the terminal by using the commands:

root@host [~]# chmod 777 /home/user/public_html/wp-content/

and

root@host [~]# chmod 777 /home/user/public_html/wp-content/uploads/

or, you can make this change using your web hosting control panel or logging in the server via your SFTP / SSH account and making that change.
Please note, this should only be a temporary change to the permissions setting! We will be changing the permissions back once the plugin install completes.

The last prerequisite we recommend is to ensure you have a working backup of your site or account (we recommend using the 3-2-1 backup rule). This rule is an easy acronym that denotes a common approach to securing your data in almost any disaster recovery scenario. The rule is: store at least three copies of your data, with two backup copies on diverse storage media, with at least one hard copy of the backups located offsite)

Start Here

Log in to your WordPress site via your browser. In your left-hand navigation menu, go to Plugins >> Add New. Then, in the top right corner, type into your Keyword search bar W3 Total Cache

search for keyword

This will bring up the search results for the W3TC plugin as seen below.

Next, click the “Install Now” button

After the plugin installs, click the Activate button


Note:
When you click Activate, page caching will automatically be running in basic mode until you modify the settings within the plugin and click save.

activate.w3tc

Now, let’s reset the permissions of the /wp-content/ and /wp-content/uploads/ folders back to 755. In your terminal run:

root@host [~]# chmod 755 /home/user/public_html/wp-content/

and

root@host [~]# chmod 755 /home/user/public_html/wp-content/uploads/

After we have activated the plugin and reset those permissions, we’ll see Performance added as a new top-level selection on the left side navigation menu. Click on the Performance link, and you’ll be taken to the W3TC Dashboard where you will see a full list of the W3TC menu items that include the following pages:

  • Dashboard
  • General Settings
  • Page Cache
  • Minify
  • Database Cache
  • Object Cache
  • Browser Cache
  • User Agent Groups
  • Referrer Groups
  • CDN
  • Monitoring
  • Extensions
  • FAQ
  • Support
  • Install
  • About

To begin, let’s click on the Check Compatibility button:

comp.check.w3tc

This result reveals what the plugin can or cannot do based on your current server configuration settings. Depending on these results, you can enable other options to allow for the full W3TC capabilities. If you need additional help in modifying your server settings, you can contact Liquidweb Support anytime to make these modifications for you.

compatibility check w3tc
Warning:
Again, always use preview mode in W3TC to test configuration scenarios prior to deploying them on the actual site. Preview mode remains active even after deploying settings until the feature is disabled.

General Settings

On the left side navigation menu, click on Performance >> General Settings to start the configuration. This is where we can enable all of the W3TC features and settings. Luckily, we will not need every setting enabled so we’re simply going to be reviewing all of the options from this window.

Page Cache

In the next section under Page Cache, we can enable Disk Enhanced mode, which is a good starting point. Click the Enable textbox, and then click the Save all settings button. Under the Disk: Enhanced drop-down menu, multiple other settings can be utilized to fit your specific needs.

pagecache
Warning:
In the next section about Minification, we offer this warning prior to offering our suggestion. Using minification can sometimes cause site malfunctions. Exercise caution and use the preview mode to test this scenario before deploying it on a live site.

Minify

minify.w3tc

Minification compresses and combines many different file types, including JavaScript and CSS on your website. Minify also shrinks your website’s code, without losing any of its functionality. You will want to use minify to improved page load times. We suggest using the Auto Minify mode.

Opcode Cache

Opcode cache is primarily used to cache PHP code. Because WordPress is coded in PHP, multiple sections of WordPress are regularly utilized when serving up a webpage. Opcode cache can cache this site code for a definite increase in performance and speed.

Database Cache

This caching option transfers work from a running database to the CPU/RAM and is not recommended if you are on a shared server. Unless you are utilizing a sizable server (like a virtual, dedicated or managed server option) with a substantial amount of RAM, leave this option unchecked.

Object Cache

object cache

The Object Cache option stores the results of complicated database queries to reduce the server’s load. For example, say a user made a simple search on your site. That search performs a full search on your entire WordPress database. Object caching stores that info for future use so the results can be provided more quickly next time. You can try this option, but I would only leave it enabled if you see an increase in backend speed.

Browser Cache

This option instructs the client’s browser to retain a local copy of the visited webpages (on their browser) when they visit your site. This reduces the overall number of calls to your website. Browser Caching speeds up your site by enabling the sites static resources to be stored in your visitors’ browsers, thereby eliminating the need for the server to continually re-supply static content over and over again to repeat visitors. You definitely need to Enable this option.

CDN

If you use a CDN service like Akamai, Cloudflare or MaxCDN, you will want to enable this option. A CDN (Content Delivery Network) is a service that stores static website content (like images, HTML files, javascript files, stylesheets, and videos) on geographically diverse servers around the world.

The client is then served up the stored content by the CDN, which reduces the load on your server. The response times for the client requests are also significantly reduced since the server that is closest to the client is used to serve up your stored content.

If you enable this option, you will want to consult with your specific CDN provider’s support pages on how to input the relevant information into W3 Total Cache. The exact process will vary depending on the CDN being used.

Reverse Proxy

Reverse proxies are an advanced concept that generally requires a significant configuration investment. Reverse proxies operate like this; If your server receives a large number of requests at the same time, it can get bogged down fetching the requested data and trying to serve up new requests.

A reverse proxy server can assist in situations like this by acting as a middleman, as the proxy server will receive the redirected requests instead of your webserver. The proxy server can then access the cache itself and serve up the requested content to the client.

This allows for the actual server to perform other tasks. There are multiple reverse proxy software titles that handle this type of duty. NginX, Varnish, and Squid can assist in a large scale operation, but its setup and configuration are best left to systems admins and developers.

Monitoring

monitoring.w3tc

W3TC integrates nicely with New Relic which functions as a performance monitoring system. Because of New relic’s ability to work with multiple programming languages and server technologies (one of which is PHP), it makes for a significant way to further optimize WordPress.

New Relic’s PHP monitoring daemon tracks performance at a deeper level. This allows for the monitoring and diagnosis of unexpected server problems that can be related to your server’s overall performance. Again, the setup and configuration of New Relic are best left to systems admins and developers.

Fragment Cache

A modern advanced website has multiple sections, parts, and elements that are specifically designed to interact differently with each client. These components can be as simple as a social media icon at the bottom of the page all the way up to a shopping cart.

Many times these elements are designed to be personalized to each user. Because these features are dynamic in nature, trying to provide caching for these objects can be challenging at best. Fragment caching bridges that gap between no caching at all and full caching.

Licensing

license.w3tc

If you have purchased the Pro version of W3TC, the license key is added here.

Miscellaneous

misc.w3tc

This section covers a variety of options not covered elsewhere in the dashboard. The first option enables the Google PageSpeed dashboard widget. The widget does require an API key to allow it to work. The other default settings should be fine to keep but, you can try enabling each one in testing mode to compare loading speeds to your baseline speed.

Debug

debug.w3tc

If you are running into problems with one of the W3TC options, you can enable this setting and W3TC will post debugging info into the HTML source code of the site. This output can then be used to assist in resolving the issue.

The downside here is that it posts debugging info into the HTML source code on a live site

This output shows data that can be used maliciously against the site so its use should be limited if at all possible. (A nice long log file would be nicer W3TC (“Hint, Hint“)

Import / Export Settings

importexport.w3tc

Should you wish to replicate the W3 Total Cache settings you have on the current server, click on the “Download” button which creates a file containing the current, active W3TC settings. You can then upload the file to another server using the import option in this section to utilize the same configurations on the other server. This option can also be used as a backup for your W3TC settings.

This concludes the main sections of W3TC. A few words in parting. Please be sure to have a good backup in place at ALL times because, when utilizing a caching system like this, having multiple backups makes things go much, much smoother.

Configuring (and fine-tuning) Individual Caching Methods

Page Caching

general-settings

In this section specifically, we can configure the settings above, which should be the most useful to all sites. Again, remember to use the Preview Mode when testing out new configurations.

Get Started Today

Want to implement W3TC on your site or set up a new Server to test out this functionality? Simply reach out to one of our Solutions or Support admins at 800.580.4985, or open a chat or ticket with us to speak with one of our experienced team members about which caching product is right for you! Also, check out awesome specials we are running on both our Dedicated line of servers as well as our Cloud offerings! You won’t be disappointed!

Author Bio

About the Author: David Singer

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Get 33% off the first 3 months on a new VPS! Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7x365 Support