Table of Contents

It’s imperative that you cache WooCommerce to speed up page loading times since 51% of customers abandon cart if the website loads slowly.

Caching saves a static version of your site so it can load much faster on each subsequent visit.

But, there are many crucial caching details that are often overlooked.

Not to worry!

Here are 7 tips to solve the often forgotten caching pitfalls to ensure you cache WooCommerce properly to keep your customers happy:

  1. Use a Content Delivery Network (CDN).
  2. Add Page Caching into the Mix.
  3. Enable Object Caching.
  4. Include Opcode Caching.
  5. Setup Varnish Cache.
  6. Reduce or Cache API Calls.
  7. Minify While You Cache WooCommerce.

I Don’t Mean to Cache You off Guard

Before you jump at the opportunity to delight your customers and cache WooCommerce right off the bat, it’s important to note that not all of your store pages should be cached.

These dynamic pages shouldn’t be cached or else users won’t be able to complete their purchase:

  • Cart
  • My Account
  • Checkout
  • Any widget or custom page that handles adding to cart, account, or checkout options

But, if you have the WP Rocket caching plugin, or WooCommerce 1.4.2 or higher installed, you can go ahead and disregard the above since it’s already taken care of for you.

For details, check out 7 Effective Ways to Fix a Slow WooCommerce Store.

1. Use a Content Delivery Network (CDN)

A CDN is a system of edge servers located around the globe that cache your website as static HTML.

No matter where your customers are around the world, they’ll be able to access a cached version of your site from the server that’s closest to them. That means if you use a CDN to cache WooCommerce, all your customers will be able to enjoy faster web page loading times.

You can check out our two articles:

But, using a CDN isn’t the only type of caching you can take advantage of to help put your WooCommerce site into hyperdrive. You can also use page, object, and database caching as well.

Using a CDN with WP Rocket

If you choose to use a CDN to cache WooCommerce, you can set it to work seamlessly with WP Rocket for enhanced performance.

Under Settings > WP Rocket in your admin dashboard once the plugin is installed, go to the CDN tab.

Then, check the Enable Content Delivery Network box, and fill out the CDN CNAME(s) field. You can also add additional CNAMEs by clicking the Add CNAME button.

Using the CDN with WP Rocket
You can set WP Rocket to work well with your CDN in a couple clicks.

When you’re done, click Save Changes.

If you use Cloudflare or Sucuri, you can enable the corresponding addon by going to the Add-Ons tab and clicking the toggle button.

wp rocket sucuri add-on
WP Rocket has complimentary add-ons for Cloudflare and Sucuri.

2. Add Page Caching into the Mix

Page caching takes all the HTML of a page and caches it on the first page load. Every visitor after that will see a huge improvement in the site’s speed.

Implementing page caching alone can increase your site’s loading speed by over 88%.

Fortunately, you can install WP Rocket and automatically add page caching to WooCommerce without having to do anything else, like fiddling with a bunch of settings and options.
Although, you can if you want to really go all in to skyrocket your site’s speed.

For details, check out Caching for WordPress, Explained in Plain English.

3. Enable Object Caching

You can also cache WooCommerce with options like Redis or Memcached for adding persistent object caching to your site.

Persistent object caching stores loaded query results so the next time they’re requested, they can be loaded from the cache instead of burdening the server and using up its resources.

Your database and server will be freed up and optimized, which results in faster web page loading times.

Redis and Memecached are two incredibly popular options for object caching, and they’re both compatible with WordPress, and WooCommerce.

They’re collectively used by top-performing sites like Twitter, Facebook, Wikipedia, Pinterest, GitHub, StackOverflow, and many others.

You can find more on that here: What is Redis Object Caching and How to Use It for Your WordPress Site, and Memcached: What Is It and How to Use It on Your WordPress Site?

4. Include Opcode Caching

According to the PHP manual:

OPCache 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.

In other words, Opcode caching compiles PHP code between each request from the database.

PHP executes by first compiling code, which is done by the PHP compiler. Then, executable code is generated that the server understands and can execute.

Opcode caching factors in at this point by caching the code that has been already compiled. That way, future requests are pulled from the cache instead of the database to free up resources.

Fewer requests to the database means less data that the site has to load which leads to faster loading times.

It’s helpful to include in your strategy to cache WooCommerce and WordPress because they’re primarily built on PHP, which is what OPcode caching, well, caches.

5. Setup Varnish Cache

You don’t have to stop there. You can also set up Varnish Cache. It’s an HTTP reverse proxy that can speed up your page loads by 300-1000 times.

An HTTP reverse proxy exists between the server and the user. It filters requests and can be used for caching.

It also has other benefits including enhanced security, GZIP compression, and more.

6. Reduce or Cache API Calls

If you use a lot of plugins that require your site to make third-party API calls, you may start to notice your site getting sluggish.

For example, if you display a Twitter, Facebook, or Instagram feed on every page, it can really get costly when it comes to speed.

While you may need to use some of these plugins, you can remove the ones you don’t really need, or reduce the amount you use them if possible.

Instead of displaying your social media feeds on every page such as in the footer, you could move it to display only on your homepage. Even though you’re not getting rid of the API calls completely, reducing the amount can help dramatically speed up web page loading times.

In most cases, you can also safely cache API calls with the WordPress Transients API.

You can check out The Complete Guide to the WordPress Transients API for details.

7. Minify While You Cache WooCommerce

While you have set out to cache WooCommerce in ways you may not have considered previously, you may as well also boost your site’s speed in other ways such as minifying scripts.

It’s one additional option that really packs a punch.

You can also minify your scripts in a few clicks with WP Rocket.

Once you have effortlessly installed it like you would for most other WordPress plugins, go to Settings > WP Rocket in the WordPress admin dashboard.

Next, click on the File Optimization tab on the page.

WP Rocket's file optimization tab
You can minify scripts for WooCommerce safely with WP Rocket.

Then, check each of the boxes as they correspond to the options on the page:

  • Minify HTML
  • Remove query strings from static resources
  • Minify CSS files
  • Optimize CSS delivery
  • Minify JavaScript files
  • Combine JavaScript files
  • Load JavaScript deferred.

The Combine Google Fonts files box is selected by default, and it’s a great idea to leave it be.

It may also be important to note that the WooCommerce documentation  recommended that you shouldn’t minify and combine, or load JavaScript files deferred with WP Rocket.
But, WP Rocket has improved, and unless there’s a unique problem, this is no longer an issue.

Additionally, it’s best practise to backup your site before enabling minification since sometimes minifying runs the risk of breaking your site.

Luckily, you can quickly reverse any changes with WP Rocket!

To do this, first disable the option that caused the error. Then, clear the cache using that option under the Quick Actions section on the Settings > WP Rocket > Dashboard page.

WP Rocket's purge cache buttons
You can quickly rollback changes in WP Rocket in a few clicks.

Cache WooCommerce for Top Page Speeds

There isn’t just one way to cache WooCommerce to speed up your site’s page load times. There’s several ways and they’re often forgotten.

With these tips and with the help of WP Rocket, you’re well on your way to having a speedy store that your customers will love to shop. Keep in mind that the right caching plugin for your WooCommerce site can make a big difference in performance!

How do you plan to cache WooCommerce to speed up your store? What has been the most successful form of caching for your site? Share your experience in the comments below.


Add a comment
Your email address will not be published. All fields are required. Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted.
Related Articles of Ecommerce
Subscribe to Our Newsletter

Stay in the loop with the latest WordPress and web performance updates.
Straight to your inbox every two weeks.

Get a Faster Website
in a Few Clicks

Setup Takes 3 Minutes Flat
Get WP Rocket Now