We’ve written a lot about server-side caching at NameHero. It allows your website to keep copies of generated pages and serve them to visitors without needing to recreate them over and over. Better speeds for your visitors and easier server loads on your end. What’s not to like?
However, caching has traditionally been useful only on largely static pages. And since WordPress was originally designed as a blogging platform, most caching solutions work on the assumption that content won’t change too often. However, WordPress has now gone far beyond its roots and is used to create all kinds of websites, both static and dynamic.
And when it comes to dynamic pages, caching becomes a lot less effective and can even negatively impact your page times. WooCommerce is one example of this.
WooCommerce and Server Caching
WooCommerce pages can have a lot of dynamic content in two ways:
- Data-driven changes – inventory stock, prices, discounts etc
- User drive changes – cart counts, user names, credit card numbers etc
All this makes it very difficult to cache WooCommerce pages. How do you create a copy of a page when the data is constantly changing? Every time a user logs in and you show them their “recently viewed” items or payment information, that is user-specific content and cannot be cached.
So there’s no option but to generate these pages from scratch. And the load adds up. Ordinary caching allows your website to scale efficiently because the workload of the server only needs to be done once for any given page. But WooCommerce websites behave in an entirely different manner.
Now the scaling is linear. The more people that use your site, the more your server load increases. And caching doesn’t seem to help much.
Or does it?
Trying to Cache WooCommerce Pages
There have been a lot of attempts to improve caching for WooCommerce pages, so as to reduce the server load when traffic to dynamic pages increases. The leading technology on this front is called “Edge Side Includes” or ESI.
ESI means you try and cache whatever you can – and only dynamically generate specific content that changes with each page load. As expected, most content – even on WooCommerce pages – doesn’t change. The majority of the HTML, inline scripts, JSON, content and descriptions etc should all remain static even if multiple different users view a user-specific page.
ESI attempts to tag these sections and generates them separately from the main page. This allows a sort of caching “in-between” system where it’s obviously not as fast as a fully cached page, but still much faster than it would have been without it.
NameHero’s LiteSpeed Includes ESI
One of the benefits of using LiteSpeed servers with NameHero, is full ESI integration with WooCommerce. The WooCommerce plugin itself designates which sections of the page are amenable to ESI processing, and the LiteSpeed caching system takes that into consideration while generating the page.
Most WordPress caching plugins don’t include ESI, and some require a paid subscription to enable it. With NameHero, LiteSpeed provides advanced ESI caching for free, regardless of which plan you choose. This makes NameHero one of the best web hosts for WooCommerce hosting.
Sometimes It’s Better to Avoid Caching
It’s easy to get too carried away with ESI. Sometimes when most (or all) of the page is dynamic and constantly changing, it’s easier to just generate the page from scratch without bothering about ESI. One example is forum software, where user-generated content rules. In such a situation, attempting to cache the page simply increases the overload more than it’s worth.
Bottom Line
WooCommerce requires special caching systems to deal with the specific parts of a page that are dynamic in nature. This can be addressed with Edge Side Includes. The LiteSpeed web server that comes free with NameHero enables this functionality, making it one of the most efficient web hosts for WooCommerce hosting.
I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!
Lucas says
Hi,
I am experiencing page loading issues on a WooCommerce shop, LiteSpeed Cache Plugin on, Flatsome Theme, Cloudflare CDN but seem to be getting an initial wait time of 5secs before anything loads.
There are no slow queries from what i can see, so unsure where to go now?
Are there too many caching options switched on?
Mark Dendy says
Hi guys,
I am too experiencing 5s+ load times with my Woocommerce site running the Flatsome theme hosted on my Namehero reseller account. I’ve got everything swithced on in the LSCache plugin that I should, plus I’ve optimized the database tables and images.
I’m seeing way faster page load times on my other Woocommerce site running Flatsome theme hosted on Siteground. I received an email from the recently stating they’ve increased the spec on their servers and I’ve seen a big. difference in performance.
GTMetrix is showing I’m not using a CDN which is incorrect or maybe it doesn’t recognise Cloudflare as a CDN?
I will reach out to support soon to see if they can help find the issue as I’ve spent hours of my time looking into this!!
Kind regards,
Mark Dendy
Ryan Gray says
Hey Mark,
Sorry to hear of your issues.
I’d suggest to start with this new tutorial I just recently published:
https://help.namehero.com/en/articles/4457756-how-to-increase-your-website-s-performance
Quic.Cloud is LiteSpeed’s version of cloudflare which integrates directly into LSCache.
Once this is completed, check it again.
One other thing, child Reseller accounts are going to have lower per-account limits than a traditional web hosting package. If the above method doesn’t speed you up, we would need to explore those next.
Also, I’m assuming with your DB optimization you made sure all of your tables are InnoDB and not using innodb for the storage engine (prevent table locking)?