Support

Find answers, guides, and tutorials to supercharge your content delivery.

Setting up WooCommerce Cache

Updated on October 4, 2018
Setting up WooCommerce Cache

How a caching plugin improves site performance

WordPress caching plugins are a popular choice when looking for ways to improve page load times. There are an array of various WordPress caching plugins available for download such as:

By generating static HTML files of your site's content and thus being able to bypass resource intensive processes, caching plugins can help offer significant improvements in loading speeds. Some caching plugins also offers other features such as minification options, CDN integration, cache exclusions, etc.

For a more detailed description of KeyCDN's caching plugin, read our knowledge base article WordPress Cache Enabler Plugin.

Caching dynamic content

Using a caching plugin on a WordPress installation is no doubt beneficial for caching certain pages and posts. However, in some cases, caching should be avoided such as in the case of dynamic content.

The purpose of caching content is to store a copy of something that does not often change (static content). This way, the resource does not need to be retrieved from the origin server each time it is requested, thus saving time and reducing latency. However, as dynamic content is comprised of content that changes often, serving stored copies is often not good practice as the content has likely changed since it was last requested.

Avoiding to cache certain elements of an ecommerce site is very important as customer information is specific to each customer.

WooCommerce cache

Setting up WooCommerce Cache is an important step in ensuring that dynamic WooCommerce pages are not being cached. For WooCommerce, these dynamic pages include:

  • My Account
  • Checkout
  • Cart

WooCommerce provides a page pertaining to WooCommerce cache and a few examples of what is required to exclude the above mentioned pages from cache. WooCommerce mentions that since version 1.4.2+ the DONOTCACHEPAGE constant has been set which allows caching plugins to properly ignore these WooCommerce pages. However, the caching plugin must support the DONOTCACHEPAGE constant. If the plugin does not support this constant, the pages should be excluded from cache directly within the plugin.

If your caching plugin requires you to define exclusions by page ID instead of by name, finding the page ID is quite easy. Simply navigate to your pages in the WordPress dashboard, find the page in question, and hover over it until you see the URL in the bottom left corner of the browser.

Make note of the page ID (which in this case is 84) for the My Account, Cart, and Checkout pages. You can then define these in the exclusions list of your caching plugin to ensure that WooCommerce Cache will safely ignore these pages from being stored.

Summary

Ensuring that your WooCommerce cache is set properly is very important to a well performing ecommerce website. Caching dynamic pages can result in a customer seeing unexpected results and thus driving them away from the checkout process. Be sure to test your WooCommerce Cache setup once you have configured both plugins to ensure that your caching plugin is performing as expected.

Supercharge your content delivery 🚀

Try KeyCDN with a free 14 day trial, no credit card required.

Get started
KeyCDN uses cookies to make its website easier to use. Learn more