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 with W3 Total Cache
W3 Total Cache is the complete WordPress Optimization Plugin that can improve your website speed. From beginner to advanced users, W3TC has the features you need. In the following guides, we will share some information to help get you up and running, and begin on your journey 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.
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.
- Configuring Browser Caching in W3 Total Cache
- What is Gzip Compression and How Do I Enable it?
- What is Brotli Compression and Why Do I Need it?
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.
- Configuring W3 Total Cache with Stackpath for CDN – Objects
- Pro Configuring W3 Total Cache with StackPath Full Site Delivery (Coming Soon)
- How to configure Cloudflare in WordPress with W3 Total Cache
Lazy Loading in WordPress with 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. Instead of caching an entire Object and rebuilding the entire object when a portion of it updates, you can break the object into multiple fragments. This is most helpful when you have many pages with similar content that is a mix of static, dynamic, and live data that require different caching contexts.
- Pro What is Fragment Caching and Why Do I Need it?
- Pro How to Use Fragment Caching with W3 Total Cache
- Pro 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.
- Pro How to use the Purge Cache Log in W3 Total Cache
- How to Enable W3 Total Cache Debug to Troubleshoot Your Configuration