Why do I receive cf-cache-status revalidated in some cases?

I’ve got simple image resizing service. Images are shown at the website with size requested, here’s an example https://i.super.fishing/86/[email protected].

It takes about 1-5 seconds to generate requested size image + delivery time. I don’t want user to wait so long, an Image ID is obviously unique so I’d like to generate it once and cache forever for everyone.

Here’s a Page Rule I use:

Cache Level: Cache Everything, Edge Cache TTL: a month

When I request image from local browser I got such response header

cf-cache-status: HIT

When I test website with https://tools.pingdom.com/ from different locations I got such response header for the same image

cf-cache-status: REVALIDATED

Means Cloudflare passes request down to my service, it generates image again and returns it to Cloudflare and then back to user. Why does it do it? The image is already in Cloudflare cache, why doesn’t it serve it directly from there?

Here is the definition of REVALIDATED:
The resource is served from cache but is stale. The resource was revalidated by either an If-Modified-Since header or an If-None-Match header.

I can confirm that the images are cached as expected: I’m getting a “cf-cache-status: HIT”.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.