Erratic behavior with APO

I’m noticing very erratic behavior with APO right now. Some of our posts will show a cache cf-cache-status: HIT while other pages will show cf-cache-status: MISS and cf-cache-status: BYPASS.

I looked to see if Cloudflare is having any issues and see nothing, but this makes no sense. This is filtering on Document on the Network tab (Disable cache is unchecked). When I check the cache status on images and fonts, I am seeing the same erratic behavior. Some are caching and some are not.

I’m using private browser, and refreshing the page over and over again, purging browser cache, Cloudflare cache, and wp-rocket cache.

Here’s some examples:

miss

In the next two screenshots, there was a successful hit for the html doc, but the fonts keep showing expired. Fonts in general will typically show “EXPIRED”, even after refreshes. .js files seem to always be a HIT.

hit

expired

bypass

1 Like

Loos like an issue with your intermediary caching layer. In x-cache-nxaccel is serving stale objects it’s not going to have any chance of being a HIT.

Appreciate the response, I looked up “x-cache-nxaccel” but couldn’t find much on it.

What is it and where’s it controlled?

Ansd when your origin cache control is “no-cache, must revalidate, max-age=0” APO respects the cache control directive. And it appears you may also have been logged in, so cache is bypassed if there’s a matching cookie to trigger it.

If it’s helpful, I also see this “origin,resnok” value at times as well.

Man, I’m ashamed to admit this, but perhaps it will help someone else later.

The pages I happened to be looking at, I had caching exemption rules on. :pensive:

Caching > Caching Rules… Have to make sure this is off.

1 Like