Cloudflare’s at it again, with a new feature that lets you store resources in its CDN permanently. As noted in my earlier article on why your CDN cache hit ratio is so low, one of the reasons is that CDNs always purge content that your visitors haven’t accessed in at least two days. This means that “long-tail” content is never cached, and why full page CDN caching hasn’t taken off.
But all that’s about to change.
CDNs Typically Ignore Cache Retention Policies
One little known fact about CDNs, is that they secretly ignore your cache retention policies! They only honor it if the content is frequently accessed – my research indicates at least once every two days. If no one accesses your content for two days or more, CDNs quietly drop your files from storage and if someone accesses it after a period of time, the CDN will query the origin once again.
Cloudflare was no exception to this rule, though given the fact that most customers use it for free, I’m not surprised. What is surprising, is that even paid CDNs ignore your caching preferences. KeyCDN, BunnyCDN – all of these providers ignore your cache control directives despite the fact that you pay them.
This Doesn’t Impact Static CSS or JavaScript Files as Much
Given that most CSS and JavaScript are loaded on every page visit, these static files will continue to receive the full benefit of the CDN. This is what CDNs were originally built for. That, and images. But the definition of what constitutes a CDN has to change with the times constantly, and these days the technology exists for a CDN to do so much more than host static content.
CDNs Increasingly Cache Whole Pages
Taking the term “CDN Hosting” to an entirely new level, many websites are implementing solutions that store entire pages – not just static CSS and JavaScript files – on the CDN. I’ve used this technique for years to reduce my TTFB to below 500 ms. It works great for my most popular pages.
But what about long-tail content?
Bad News for “Long-Tail” Resources
The above policy means that a website with many “long-tail” resources or content will benefit less from a CDN. “Long-tail” in this context means content that isn’t accessed often, but you might have a lot of it. There’s a saying that 80% of your traffic comes from 20% of your pages. But some sites might have a lot more long-tail content than others. What if 80% of your traffic comes from long-tail content?
In such a scenario, full-page CDN caching doesn’t help as much.
Cloudflare’s Cache Reserve Feature is in Beta
Cloudflare’s new “Cache Reserve” product lets users use Cloudflare R2 storage to store their CDN resources in cache – forever. This makes Cloudflare the first CDN to promise infinite cache retention with 100% hit rates and the ability to cache everything, including HTML files.
Naturally, this comes with a cost – storage. Or to be precise, the cost of writing to storage. The actual storage costs are quite minimal, as is the cost of reading from it. But writing to R2 is called a “Class A” operation, costing $4.50 per million writes. But considering that you only need to write a resource to cache once, it’ll be far less than the cost of hosting itself!
Changing the Face of Static Web Hosting
This feature has the potential to radically rework the hosting of websites that serve mostly pages that don’t change often. With Cache Reserve providing a 100% cache hit ratio, the origin server comes under less stress than ever. Of course, pages with dynamic content will still continue to benefit from high-end hosting, but for static web pages, the page load speeds will be entirely independent of the hosting provider.
Backend operations like the WordPress dashboard and editing will depend on the origin server’s speed. But only you see that. On the other hand, your visitor will receive content directly from Cloudflare’s distributed R2 storage and speeds no hosting provider can match.
So sign up for Cloudflare’s Cache Reserve and tell me what you think!
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!
igre says
i use this feature on Cloudflare…