CDN providers are getting into the caching game. They’re realizing that the days of restricting caching to static content are over. Now many of them are exploring ways to take entire HTML pages and store them on EDGE servers. Cloudflare recently took an official step towards this goal when it introduced its “Automatic Platform Optimization” or APO tool. I’d written about how APO would work in an earlier NameHero blog post. The question now is – where does that leave server solutions like LiteSpeed caching? Do they do the same thing? Is it worth using both at the same time?
Note: Here I’m talking about the LiteSpeed server itself that does the caching. This isn’t about QUIC.cloud – the new LiteSpeed service that is a mirror to Cloudflare’s proxy CDN.
You Can’t Use Cloudflare Caching on all Sites
The new trend to cache HTML pages in the cloud only works for a specific type of website. One that is mostly static, and doesn’t have many user interactions. For example, a blog or a news site can make good use of server caching. But if you need your users to log in, and if you have to show them personalized information, it doesn’t work so great. Visitors will see outdated content, even as their pages load instantly!
The best example of the type of site that has problems with CDN HTML caching is e-commerce stores. These stores have information that is highly personalized and customized for visitors. For example, the number on the “cart” icon that shows you how many products you’ve added. Pages displaying billing information, or updated inventory numbers. Personalized recommendations for users based on their browsing history, or review pages that keep changing.
All of these are dynamic website functions, and these pages cannot be offloaded to the cloud. At the most, you can perhaps cache your “Contact” and “About” pages, but that’s it. It’s useless to try and cache the rest.
LiteSpeed Works with WooCommerce
This is where the LiteSpeed cache shines. Since the server integrates directly with your site through a WordPress plugin, the WooCommerce code can explicitly tell your server which parts of pages it can cache and which ones it should leave dynamic. This is the best of both worlds – a situation where static parts of a page are served directly from memory instead of being generated each time, and only the dynamic parts are modified.
The end result is the fastest possible rendition of e-commerce pages. The LiteSpeed scache offers a level of caching that Cloudflare will never be able to achieve because of the lack of integration with the backend.
Purges Happen Instantly with LiteSpeed
Despite its best efforts, the fact remains that the Cloudflare servers are located far away from your origin. So when you need a page to be purged because the stock inventory information has changed, it can take up to 30 seconds for Cloudflare to update the information and purge the old data.
Needless to say, this is too long for dynamic sites where visitors need to see updated information immediately. LiteSpeed page purges are instant because it’s on the same server. Another reason why Cloudflare cache will never be as fast as LiteSpeed cache for certain types of web pages.
Enable BOTH for Static Sites
For static sites that don’t change much, you can get extended benefits by using LiteSpeed cache and Cloudflare’s cache. The former will take care of those “low volume” pages that Cloudflare misses (the fat tail pages so to speak), and Cloudflare will handle the high-volume, frequently accessed pages that make up a good percentage of your site’s visits.
Using both in tandem gets you the best of both worlds. There’s no need to choose one over the other when it comes to static sites. But for dynamic ones, you’re going to want to stick to LiteSpeed over Cloudflare!
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!