Get Started

WooCommerce Caching: How to Implement Caching in Your Online Store

Editorial Team
March 12, 2024
WooCommerce Caching: How to Implement Caching in Your Online Store

Do you want to learn about WooCommerce caching and how to use it in your store?

With the increasing complexity of online transactions and attempts to customize the WooCommerce store, your website can face significant speed-related issues.

Ideally, it’s best to cache your website content for maximum performance.

But, it is not at all recommended to cache the WooCommerce website. There is enough dependency on user sessions and the need to dynamically load content, such as updates related to cart items or product stock.

Performing aggressive caching in WooCommerce affects your store performance, such as product prices getting incorrectly displayed, payment transactions not going through, etc.

You’d have to be mindful about caching different elements of your WooCommerce website to ensure everything on your store works smoothly.

And that’s exactly why we’re here to help.

In this article, we’ll help you understand everything about WooCommerce caching and how you can implement it in your online store.

By the end of this post, you’ll be able to ensure your online store delivers a fast and secure shopping experience to build trust with your customers.

If you want to enhance your store's conversions and grow your WooCommerce business, FunnelKit is here for you — hit the button below to find out more!

What is Caching?

Caching, in simple terms, involves storing frequently accessed website data temporarily to reduce load time, allowing the end-user to load the website faster.

This cache consists of high-speed data storage that enables quick data retrieval when customers access your online store.

If a website has been cached, its assets can be served quicker than if a website has to load pages each time it’s requested.

This ensures swift data retrieval, boosting load speed and enhancing user experience in your store.

There are two main types of caching:

1. Full-page caching

Full-page caching refers to caching the entire website’s HTML output. 

When a user visits your website, the server can quickly deliver the cached copy instead of processing each file individually.

2. Object caching

Object caching involves storing frequently accessed objects, such as database queries or API requests, in memory to speed up your website.

Many businesses use caching systems and tools like Memcached and Redis to implement WooCommerce object caching.

These tools provide a fast and efficient way to store and retrieve data in memory.

Different Sources of Caching

Let’s look at different sources of caching:

  • Browser caching - It’s a mechanism used by web browsers to store web page resources (images, CSS, and scripts) locally. To shorten page load times, browsers save a copy of the web page’s content on the device’s hard drive and retrieve it when requested. This is rarely an issue to focus on.
  • Plugin caching - Some plugins implement caching mechanisms that store frequently accessed data or computations. This helps optimize performance by storing and using such data, reducing the need for doing redundant computations or resource-intensive operations.
  • Content Delivery Network (CDN) - A CDN caches content (such as images, videos, or webpages) in proxy servers, which are located closer to end users than origin servers. Because the servers are closer to users making the request, a CDN delivers content more quickly.
  • Database caching - It involves storing frequently accessed query results or data objects in temporary memory. It stores a subset of data in a transient storage layer that serves data much faster because it’s possible by accessing the primary database.

How Does Aggressive Caching Affect WooCommerce?

By default, many caching plugins don’t cache logged-in users. 

But even if you do cache logged-in users, your WooCommerce website can face some serious issues, such as:

  • Products displaying outdated information such as prices, stock availability, or product descriptions
  • Improper functionality of shopping cart and checkout pages, where real-time and personalized data matters 
  • Customers able to view other customer’s account information, carts, or order history
  • Challenging cache invalidation that leads to delayed updates on your store
  • Dynamic pricing issues that display original prices rather than discounted prices
  • Search and filtering functionality is affected, leading to inaccurate results

As a store owner, you must ensure that your online store is secure and adheres to all legal compliances.

For that, it’s essential to set up WooCommerce caching correctly in your store.

The first step towards it is to exclude specific pages from the cache to avoid any issues or discrepancies in your WooCommerce store.

This is exactly what we’ve covered in the next section.

What Should You Exclude from Caching?

As discussed above, caching your WooCommerce website may cause several functionality issues affecting conversions in your store.

To avoid such scenarios, it’s crucial to exclude certain dynamic pages of your WooCommerce store.

WooCommerce pages to exclude from caching

Here is the list of WooCommerce pages that need exclusion from caching:

  • Login and registration pages
  • Cart page
  • Product pages 
  • Checkout page
  • My account page

These are the primary dynamic pages where the content changes based on user preferences.

In addition, WooCommerce has a DONOTCACHEPAGE constant that you can use to manually exclude specific pages from caching.

But you can use a reliable plugin compatible with WooCommerce to make things easier.

WooCommerce sessions to exclude from caching

Exclude the WooCommerce session identifier _wc_session from caching.

_wc_session holds all the details of your customers’ carts and their shipping-related information. Caching it could cause issues like showing the wrong cart items and incorrect billing or shipping details.

Some of the best WooCommerce cache plugins already exclude various query stems, including the _wc_session.

WooCommerce cookies to exclude from caching

There are four WooCommerce cookies that you should exclude from your cache:

  • woocommerce_cart_hash - It handles the identifiers that determine when the cart gets updated or refreshed.
  • woocommerce_items_in_cart - Identifiers that help WooCommerce determine the correct items inside the cart.
  • wp_woocommerce_session - This cookie has a unique code to find the shopping cart data in the database for each customer.
  • woocommerce_recently_viewed - It powers the recently viewed widget and ensures it correctly displays each item for every visitor.

For more information, check out the official Woo documentation.

Use Custom WooCommerce Checkout or Upsell Pages? Here’s How to Exclude the Pages Using Different Plugins...

FunnelKit Funnel Builder powers 20,000+ WooCommerce stores. Users have been using it to create high-converting checkout pages and upsell offers to generate more revenue than ever.

You can use it to customize your checkout pages and include all the high-converting elements to drive conversions.

It's the best all-in-one WooCommerce checkout manager tool to have in your store.

High-converting checkout page created with FunnelKit Funnel Builder

You can even offer order bumps and one-click upsells to boost the average order value in your WooCommerce store.

To ensure smooth operation, we recommend excluding pages created with FunnelKit Checkout or Upsells from your store.

In the section below, we will demonstrate how to exclude FunnelKit Checkout and Upsells from different caching plugins.

Make sure to copy the permalink slugs of checkout and upsell pages from the Funnel Builder's global settings.

Go to the global settings of Funnel Builder and copy the checkout and upsell page permalinks

Let’s explore.

Excluding the FunnelKit Checkout and Upsell pages from caching in WordPress plugins

Find the step-by-step process of excluding the checkout and upsell pages from caching with different WordPress plugins.

WP Rocket

Go to the WP Rocket settings.

WP Rocket settings to exclude from caching in woocommerce

Next, hit the ‘Advanced Rules’ section and paste the permalink slugs there.

Go to advanced rules section and exclude the checkout and upsell url to set up woocommerce caching

Once done, click on the ‘Save Changes’ button at the bottom.

Well done! You have successfully excluded FunnelKit Checkout and Upsell pages from caching using the WP Rocket plugin.

WP Super Cache

Open the settings of WP Super Cache and go to the ‘Advanced’ tab.

WP Super cache settings - advanced tab

Scroll down to the ‘Rejected URL Strings’ section and paste the FunnelKit Checkout and Upsell permalink slugs.

Go to rejected url strings section and exclude the checkout and upsell url to set up woocommerce caching

Make sure to hit the ‘Save Strings’ button when done.

That’s it! This is how you can exclude the URL strings from caching using WP Super Cache.

W3 Total Cache

Go to settings of W3 Total Cache and click on ‘Page Cache’.

W3 total cache settings - page cache section

Scroll down to the ‘Never cache the following pages’ settings.

Paste the permalink slugs of the FunnelKit Checkout and Upsell pages there with /checkout* and /offer*.

Go to never cache the following pages section and exclude the checkout and upsell url to set up woocommerce caching

Once done, hit the ‘Save Settings’ button.

This will exclude all the FunnelKit Checkout and Upsell pages from caching.

WP Fastest Cache

Click on the WP Fastest Cache on your WordPress menu.

Click on WP Fastest Cache from the wordpress dashboard

Go to the ‘Exclude’ tab and hit the ‘Add New Rule’ button.

Go to the exclude section and click on add new rule

Choose ‘Contains’ from the drop-down and paste the checkout permalink slug there.

Click on ‘Save’ when done.

Choose uri contains and and exclude the checkout and upsell url to set up woocommerce caching in WP Fastest Cache plugin

Similarly, do it with the FunnelKit Upsell permalink slug and save it.

These are the final settings you saved.

Exclude the FunnelKit checkout and upsell pages to set up woocommerce caching in WP Fastest Cache plugin

This will exclude all the FunnelKit Checkout and Upsell pages from caching with the WP Fastest Cache plugin.

Breeze (Cloudways)

Breeze is a WordPress cache plugin.

Navigate to Settings ⇨ Breeze from the WordPress menu and click on the ‘Advanced Options’ section.

go to the breeze plugin settings from wordpress menu

Paste the FunnelKit Checkout and Upsell URLs using the wildcard.

Exclude the FunnelKit checkout and upsell pages to set up woocommerce caching in Breeze (cloudways) plugin

Hit the ‘Save Changes’ once done.

This way, you’ll be able to exclude the FunnelKit checkout and Upsell page URLs from caching using the Breeze plugin by Cloudways.

Excluding the FunnelKit Checkout and Upsell pages from caching with CDN Enabler (KeyCDN)

Go to the Settings of CDN Enabler.

Go to CDN Enabler settings from the wordpress menu

Paste the checkout and upsell page URLs into the ‘CDN Exclusions’ field, followed by the wildcard.

Include the checkout and upsell page strings you want to exclude from woocommerce caching in cdn enabler plugin

Once done, hit the ‘Save Changes’ button.

Excluding the FunnelKit Checkout and Upsell pages from caching in different hosting providers

Cloudflare

Log in to your Cloudflare account and go to the ‘Page Rules’ section.

Next, click on the ‘Create Page Rule’ button.

Log in to your cloudflare account and hit the create page rule button from page rules section

Paste the FunnelKit Checkout and Upsell page URL there.

Next, choose ‘Cache Level’ and choose ‘Bypass’ as the cache level.

Add a page rule to exclude the funnelkit checkout and upsell url from caching - select the cache level and choose bypass

Make sure to hit the ‘Save and Deploy Page Rule’ button.

Then create the same page rule for the FunnelKit Upsell page URL; this is how you can exclude the checkout and upsell page URLs from caching in Cloudflare.

Other hosting providers

Similarly, you can send an email or raise a support ticket with your hosting providers to exclude the checkout and upsell pages from caching.

You can write this email prompt:

Hi!
My site runs the custom checkout pages by FunnelKit and we want to exclude checkout pages from caching. The FunnelKit support team has instructed us to ask you to place a cache exception on our checkout and upsell pages.
Could you please add the URLs which follow this pattern to the exception list?

http://YOURSITE.com/{put your checkout page URL here}
http://YOURSITE.com/{put your upsell page URL here}

Thanks!

Their support team will help you with URL exclusion in no time.

How to Test the WooCommerce Store after Caching?

Once you’ve configured your caching plugins for WooCommerce, it’s time to test everything works fine on the front end.

First, open the incognito mode of your web browser and test these things in your online store.

Please note that it’s important to perform these tests in non-logged-in mode. If exclusions are proper, then checkout and upsells won’t serve cache and everything will work smoothly.

Product pages

Go to your store and make sure to test the following:

  • Load the shop page and ensure that it displays the correct products
  • Load the category pages and ensure these display the correct products

Checkout functionality for guest and existing customers

Add a product to your shopping cart and proceed to checkout as a guest customer. Make sure to test the following:

  • The checkout page shows the correct information (including cart items, subtotal, payment methods, etc.)
  • Proceed to the payment and check if it’s complete
  • Go to the WooCommerce orders and see if the correct order status is applied

Once done, repeat the same steps after you log in to your store as an existing customer.

WooCommerce coupons

Create a WooCommerce discount coupon and apply it to the coupon section on the checkout page. Ensure the following:

  • The coupon is successfully applied
  • The amount in the cart and the subtotal are updated correctly

My accounts page

Go to the ‘My Account’ page and reset your account’s password. Log out of your account and log in again with the new credentials to ensure it works properly.

Well done! These are a few things you can do to test your WooCommerce store after caching.

Effective Troubleshooting and Tips

Let’s look at some troubleshooting and tips for effective WooCommerce caching.

Tip #1: Use the incognito mode to test your WooCommerce store processes after caching

Many cache plugins don’t cache the WordPress admin area to ensure that real-time changes can be made without interfering with cached versions.

So, when they test their flow from the product page to the checkout page to the thank you page, it seems everything works fine.

However, this is not the correct way to test your website after setting up WooCommerce caching.

Your customers or visitors may encounter certain issues that we talked about in this post, such as product prices getting incorrectly displayed, WooCommerce cart cache issue, payment transactions not going through, etc.

That’s where the incognito mode of your web browser really helps.

Using the incognito mode allows you to view the front end of your website as a regular user, ensuring the changes are indeed taking effect, and everything is working smoothly (including the page loads, dynamic information displaying correctly, and transactions effectively processing through).

Tip #2: Choose the right cache plugin

Choosing the right WordPress caching plugin for WooCommerce is crucial for optimizing your store’s performance.

There are different caching plugins, such as WP Rocket, WP Super Cache, W3 Total Cache, and WP Fastest Cache, and built-in cache plugins from hosting companies, including SiteGround, WP Engine, Bluehost, etc.

Make sure to consider different factors when selecting the best cache plugin for WooCommerce:

  • Works seamlessly with WooCommerce
  • Cache exclusion for WooCommerce
  • Supports fragment caching for WooCommerce dynamic elements
  • Offers mobile optimization features

The effectiveness of a caching plugin also depends on your specific hosting environment.

Thus, it’s essential to consider the recommendations of your hosting provider and your store’s requirements when choosing.

Tip #3: Clear browser cache

In WooCommerce, it’s crucial to display real-time information. Certain elements, such as product prices, availability, cart details, etc., change dynamically.

Even if you exclude certain WooCommerce pages and cookies, your browser may still load a cached version of the page that displays outdated information.

This is why you should clear your browser cache and try loading your website in the incognito browser session.

Access your browser settings and navigate to the Privacy page to clear the cached data.

Tip #4: Check for plugin updates or disable any conflicting plugins

It’s important to check the updates of your caching plugin on your WordPress dashboard.

Developers regularly release certain updates to fix bugs, improve performance, and ensure compatibility with the latest versions of WordPress and other plugins.

Also, ensure that your plugins don’t show any conflicting warnings because they can impact the functionality of your caching setup.

If there is a conflict, deactivate the plugin from your WordPress menu and contact the plugin team to solve the issue.

Tip #5: Check for WooCommerce error logs

Enable WooCommerce to debug logging after you’ve set up caching in your store. This helps you have general PHP and WordPress warnings, error messages, and status information.

To enable debug logging, check out the official Woo documentation.

Plus, you can check the error logs by navigating to WooCommerce ⇨ Status and on the Logs section.

Check for woocommerce error logs by going to the woocommerce status - logs section

These logs can often provide valuable information about the reason for caching issues on your store.

If you face any issues, feel free to contact our Support Team, and we'll help you out.

Should You Minify Your Website’s Code During Optimization?

The size of your WooCommerce store or WordPress website’s code can impact its speed and functionality. That’s where minification comes into play.

Minification involves removing unnecessary characters, such as whitespaces and comments, from your website’s HTML, CSS, and JavaScript files.

This makes it easier for browsers to parse and deliver results quickly.

WooCommerce does not recommend minifying the JavaScript. But it can help improve the performance of your online store.

Our experts suggest that you minify JavaScript on your website but exclude WooCommerce scripts from this process. 

  • Avoid using inline JavaScript - By separating your JavaScript code into external files, you can reduce the code that gets parsed during each page load.
  • Combine multiple JavaScript files into one - By merging all your JavaScript files, you can reduce the HTTP requests the customer’s browser makes.

It’s important to avoid minification on checkouts and upsells.

Are You Ready to Set Up WooCommerce Caching in Your Store?

As a WooCommerce store owner, it’s critical that you ensure that your WooCommerce website delivers the best shopping experience to your customers.

This includes correctly configuring WooCommerce caching in your online store.

We hope you’ve understood why aggressive caching leads to issues in your WooCommerce store and the importance of excluding dynamic content.

We’ve also demonstrated the exclusion process if you use FunnelKit Checkout and Upsells to transform your store’s shopping experience.

This guide is more than enough to keep you in a good position to take the next steps.

Also, if you’re not a FunnelKit user yet, you’re missing out on the opportunity to enhance your store’s conversions and make big sales!

So why wait?

Author: Editorial Team
The Editorial Team at FunnelKit (formerly WooFunnels) is a passionate group of writers and copy editors. We create well-researched posts on topics such as WordPress automation, sales funnels, online course creation, and more. We aim to deliver content that is interesting and actionable.
chevron-down