Skip to content
Insight on digital media from the team at LexBlog, Inc.

Performance upgrade: Adjusting caching intervals for faster load times

99park—compute

Illustration by Greg Storey

November 12, 2021

WP Engine, our web host, is one of my favorite technology companies.  Their policies and services tend to land at a spot on the “hand-holding” vs. “you’re on your own” spectrum that works very well for us.  Therefore I like to pay close attention to their new service offerings, because there’s often something new and useful for our platform every time they update.

This week they launched a variety of new options pertaining to server-side caching.  That is, caching that occurs on the web server, independent of whether the site visitor clears his browser cache or not.

cache

The settings UI that WP Engine provides for managing cache TTL.

The default cache lifespan is 10 minutes, and that’s been the only option until now.  That’s better than nothing, but really almost all of our content would be perfectly fine with a much longer cache lifespan.  Therefore I’m in the process of setting our blogs to cache for 60 minutes.  I have an eye toward increasing that even further, but I like to proceed gradually.

A handful of fine points:

  • This caching pertains to site visitors who are not logged in.  Logged in users, such as blog authors, are not subject to this caching.  They see updates right away.
  • The cache is updated instantly when a major change to the blog occurs, such as a new post being published.  This is nice because if you publish your post at 11:30, say, and your email notifications are scheduled to go out at 12:00, that new post will still get picked up.
  • Cached pages serve in a manner that is on par with a pure HTML front end — front ends that are sometimes termed “headless” or “static”.  The cached page makes zero database queries, zero http requests, it does not even execute any php code.  Therefore it suffers zero performance disadvantage when compared to something like Netlify or Eleventy.

I’ll be very interested to monitor the effect of this change when it comes to resource consumption.  We sometimes see issues where bots or various forms of automated traffic ping our sites at a very high frequency.  Steps like this will keep more bots where they belong — on a cached page — resulting in better performance for our actual site visitors.

Posted in: