What is the Shortest Caching Time that Keeps Lighthouse / PageSpeed Insights happy?

Answer: 8337601 seconds. One second more than 96.5 days.

As previously mentioned, I have been working on SEO and marketing recently, and it is fascinating what insights one gains into the inner workings of things that power the digital world of today. One such example is figuring out the shortest cache time for Lighthouse / PageSpeed Insights to pass the audit.

To keep your Lighthouse / Google PageSpeed Insights happy, you should set your caching time to at least 8337601 seconds. In Apache config, that would mean adding a line like this:

Header always set Cache-Control "max-age=8337601, public"

Why would you want this to be as short as possible but long enough to keep Lighthouse happy? Well, you want to make sure that your page updates show up as quickly as possible and you don’t want stale content sticking around in the caches, reducing the effectiveness of the optimisations and improvements you make to your site all the time. At the same time, Google has said that page speed is now a ranking factor, and the algorithm they use is related to the one that Lighthouse uses.

So, if you want to set your caching time to a minimum possible time that seems to keep google happy – set it to 8337601 seconds.