W3 Total Cache
W3 Total Cache is a feature rich WordPress caching plugin that provides the tools needed for optimizing your WordPress website.
With the plethora of options that are provided, it may not be immediately obvious how you should configure W3 Total Cache for your site. In this guide, we will review the features within the WordPress performance plugin and provide some suggestions on how each mechanism might be used to help speed up your WordPress Website.
Getting Started – W3 Total Cache
W3 Total Cache is the complete WordPress Optimization Plugin that can serve from beginner to advanced users and beyond. Due to the number of features within W3 Total Cache (W3TC), setting the plugin up can be overwhelming if you do not know what the options are referring to. Here, we will share some information to help get you up and running, and begin on the path of improving your WordPress website performance and speed.
The Dashboard for W3 Total Cache contains your at a glance view for all things W3TC. Here you can purge or empty your caches, find your Statistics (Pro), Google PageSpeed Insights Report as well as links to our Pro Support, Premium Services, blog, changelog articles and the WordPress Support Forums to follow the discussion on current topics about W3 Total Cache.
- Perform a WordPress Compatibility Check with W3 Total Cache
- Enable the Google PageSpeed Insights Widget in W3 Total Cache
- W3 Total Cache Support Options and Premium Services
- Configuring W3 Total Cache for WordPress with Shared Hosting
- Configuring W3 Total Cache for WordPress with VPS or Dedicated Hosting
Page Caching is a powerful optimization that reduces the response time of your site by storing the web pages that are generated. Future users will be served the stored copy of the web page rather than having each page re-generated for them.
When minifying assets, this consumes resources such as CPU and Memory, and may increase the time required to respond to HTTP requests for the minified content. Because of this, Minification should always be used with properly configured caching. In environments with limited resources, minification may have an adverse impact on general performance.
Opcode Caching improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request. It is always a good idea to have Opcode Caching enabled as this functionality cannot be disabled, though when enabled it will report the actual state and (in the Pro version) statistics.
In production environments, you may have slightly better performance by disabling the “Validate timestamps” option under General Settings > Opcode Cache.
When this option is disabled, cached files will not be recompiled on PHP file updates, such as when the file modification time changes, and will only be recompiled on PHP restart.
While Object Caching will store executed PHP which may or may not contain information retrieved from your database, it may not cache the majority of calls to your database. If after enabling Object Caching you have many database queries being performed, it’s time to cache the database queries themselves.
Database Caching assists with freeing up MySQL server resources taken by serving repeated queries returning the same data each time, so that it has more power to handle real dynamic data.
While Page Caching can greatly help to reduce the response time of a site through caching static pages, there are still many non-cached requests for Objects. Object Caching will further improve performance by caching these Objects.
The idea of an Object Cache is that the WordPress Core, themes, and plugins may store some data that is frequently accessed and rarely changed in an object store. This is so these objects will not have to be retrieved and processed on each request. Ultimately, Object Caching will reduce the total number of database queries required for each page, and because the CPU does not have to rebuild these blocks of data your response time will decrease.
Browser Caching is extremely important for improving site performance, and it is recommended that you enable it in nearly all situations. Browsers are already parsing HTTP headers, so we can add some information to these headers that declare how long the assets should be held on to, or if the browser should download a newer copy.
Content Delivery Network (CDN)
When your website has noticeable traffic and contains a lot of images, having a Content Delivery Network, or CDN is a great way to lower your web server resource utilization (it will handle only your HTML content), speed up loading times because assets will load faster, and even decrease your monthly web hosting bills.
W3 Total Cache Pro allows you configure your CDN to deliver cached versions of your sites assets, giving you huge performance gains when configured properly.
Lazy Loading in W3 Total Cache allows you to defer the initialization of images until they are needed, allowing your page to load much faster than normal. When loading the elements of a page that are needed to display, typically images and video have significant payloads. Instead of loading on initial request, these non-critical resources are loaded when needed.
W3 Total Cache provides Pro Users with detailed information about your site’s performance. Statistics allow you to visualize your performance over time with graphs, and examine the overall performance of caching method backends. Using these reports, you can fine tune your WordPress website’s performance like never before.
Fragment Caching allows breaking objects into multiple pieces that may be cached and generated with more granularity than Object Caching alone. The idea is that rather than simply caching an entire Object and rebuilding the entire object when a portion of it updates, you can break the object into multiple fragments.
While Fragment Caching is a powerful way of optimizing a large site with static and dynamic content, it requires a developer to make modifications to theme, plugin, or other such code in order to function. This is most helpful when you have many pages with somewhat similar content that is a mix of static, dynamic, and live data that require different caching contexts that you are willing to manually intervene in to improve performance.
- What is Fragment Caching and Why Do I Need it?
- Choosing a Fragment Caching Method for W3 Total Cache
W3 Total Cache has a debug system that will append HTML comments to your page’s source code allowing you to track down issues with your configuration. This mode is to be used sparingly, as performance will be degraded due to the demand it puts on your server to populate the additional information.
- How to Enable W3 Total Cache Debug to Troubleshoot Your Configuration
- How to use the Purge Cache Log in W3 Total Cache [PRO FEATURE]