• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • VPS Hosting
    • WordPress Hosting
    • WooCommerce Hosting
  • Reseller
  • Enterprise
  • Domains
  • Account
  • Blog Home
  • Categories
  • Authors

Two Layers of Caching is Optimal – No More No Less

Bhagwad Park

Published on: October 2, 2020

Categories: Website Performance 0

I’ve tried a lot of different caching configurations on my site over the years. 3rd party plugins, server-based caching, Cloudflare caching – and I soon hope to try LiteSpeed’s new QUIC.cloud. I’ve experimented with different configurations, combining multiple techniques, and I’ve finally settled on my preferred setup – two layers of caching. One at the local server, and one somewhere on the cloud. I believe it provides the best mix of performance and flexibility for an average WordPress site.

Let me explain the two layers that I use, and why I believe my set up is the best.

1. Caching at the Origin – Either 3rd Party Plugins or Server-Based

The first layer of caching that I recommend, is at your origin server. If you’re using WordPress, this can take the form of 3rd party plugins like W3 Total Cache or WP Rocket. Or if you’re lucky enough to host with a provider like NameHero, you can use the built-in server caching of LiteSpeed. As explained in the linked article, the latter if faster than the former because it doesn’t use up server resources allocated to your website, unlike other PHP based plugins on WordPress. So you don’t suffer any performance penalty for using it.

Caching at the origin means that every page is generated exactly once.

2. Caching on the EDGE

I’ve hovered back and forth between the usefulness of caching content on the EDGE. On the one hand, it seems to run into problems with EDGE CDN providers like Cloudflare discarding your cached content if its not accessed for a couple of days. And on websites with hundreds of URLs, this means that a large chunk of your content will always remain uncached. Plus, if you make a change on your site, the entire cache needs to be purged again. Hence, I was against it.

But then I started to use it differently with only caching for a few top performing pages. The free Cloudflare plan allows you only 3 rules, so it can get rather sticky if you want to cache specific pages, but if you pull the lever for the Pro plan, you get a whopping 20 page rules to play around with. This can dramatically speed up the most important parts of your site.

Lately, I’ve started using the WP Cloudflare Super Page cache to reduce my global TTFB to less than 0.5 seconds. The plugin takes a lot of the headache out of EDGE caching, with automatic page-specific content purging, allowing us to access the admin area without breaking the page cache, or accidentally serving logged in content to anonymous users. It works great! I suggest you check it out.

Why the 2-Tiered Structure Works

The 2-tiered structure works for two different types of content. Frequently used content gets served via the high-speed page cache. Relatively little used content gets sent to the origin server, where it is served using the generated cache. The advantage of the latter is that it has no expiry date. I suppose there is a slight delay when the cached content is not found at the EDGE, and has to go to the origin, but compared to the benefits, I believe the trade-off is more than worth it.

Bottom Line

So two caching tiers appear to be the optimal choice. Using this, I’ve managed to greenlight all my Core Web Vitals metrics in the Google Search Console. And with a little bit of experimentation, you can do the same. Stay tuned for more updates on this, as NameHero continues to push the boundaries of what’s “standard” in web hosting!

Bhagwad Park Profile Picture
Bhagwad Park

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!

Related Posts

Why You Should Turn On “Crawler Hints” For Your Site

Crawler hints allow search engines to see what's changed on your website at a glance, thereby reducing the need for wasteful crawling.

What Is ERR_CERT_COMMON_NAME_INVALID, And How Can You Fix It?

What is ERR_CERT_COMMON_NAME_INVALID and how can you fix it? Check out our guide to learn everything you need to know!

Four Ways To Fix The PR_END_OF_FILE_ERROR Message

This quick guide will cover all the necessary steps you need to know to address the appearance of the 'PR_END_OF_FILE_ERROR' on your screen

Use Cloudflare To Change Response Headers

Steps to use Cloudflare to change response headers on your site. This allows you to control caching, indexing, and a lot more.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!

Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup (2023)

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Domains
Help & Support
  • NameHero Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2023 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA