APO is meant to cache static content HTML, and the presence of cookies tell it the content might not be static, even if it seems so to our eyes. You’re probably (I’m trying to guess here, it could be other cookies) running your tests with a logged-in browser tab.
That means you’ve successfully removed one issue, and now you are seeing what visitors will.
Still, it’s another layer of caching that makes troubleshooting more difficult. Can’t you turn off Nitro’s caching and use only its optimization settings, and see how that goes?
Also, the fact that now you’re seeing cf-cache-status: EXPIRED as opposed to BYPASS means your page is supposed to be cached, but something keeps telling APO that there’s new content, when in fact there isn’t. So the cache keeps being invalidated. You need to investigate why your origin keeps updating the last-modified: header when apparently there’s no new content.
LiteSpeed isnt a plugin by itself.
Unless its been bundled with another plugin that I’m not aware of.
But I’m not running anyother caching plugins.
Cloudflare (for APO)
NitroPack (for everything including caching)
RankMath (for SEO)
Smush Pro (for image optimisation)
Thrive Themes (as my my theme builder)
And a bunch of other plugins for various purposes
I might run through and deactivate the plugins to check if any of them is causing the issue
I did some more testing and discovered that there’s pretty much no rhyme or reason about when what cache gets triggered or skipped.
I created a screen recording about the situation here https://nimb.ws/YD0hlP
And it shows that on a page refresh there are a number of caches that could get triggered or skipped.
NitroPack support said the following in response to me showing them the above video.
Thank you for the update!
I have reviewed the matter, and I can confirm the same behavior, however, I’m not fully sure if something could be done on our end.
I will try to explain our integration and what its main function is.
Basically, what we use the API integration for is to make sure that the Caches are in synch. However, this is ensured by syncronizing the cache purge/invalidations requests and that is it. Typically when the cache is refreshed at the same time that means that each new cache no matter its origin, it will contain all tthe fresh data. This is the mechanism that we use to synchronize the caches via our integration.
On our end we cannot confirm why exactly the CF APO cache is behaving like this. I believe the best shot here will be to consult with the support of that feature or Cloudflare and ask them if something has been done incorrectly on the configuration’s end or to check for misbehavior in their service!
Technical Support at NitroPack
So right now I’ve got no idea who to speak to to get this resolved.
Our Developers are advising us to check with Cloudflare why this is happening, and after the issue with the APO is resolved and there is something related to NitroPack, we can check again.
So it seems that for some reason APO is causing the issue