Some of my Images not cached

I am pretty confused on how cloudflare images work, some of my images cached and some are not, maybe I have some misunderstanding with cloudflare cdn.
Let’s say I have a site with:

example.com
img.example.com

I want to cache all images for 1 year on img.example.com.

Should I use page rules or cache rules?

I have already made sure the cache control is public with max age=31536000. Can you recommend a setting that can override cache control and cache the images for 1 year?

For now, I’m testing it using redbot.org, and it seems to work, but I don’t know if my configuration is correct.

Page Rules:
img.example.com

  • Cache Everything
  • Edge TTL = 1 month

Cache Rules:

  • Hostname: img.example.com
  • Eligible for cache
  • Ignore cache-control header and use this TTL: 1 year

Some typo, my page rules was like this

Page Rules:
img.example.com/*

  • Cache Everything
  • Edge TTL = 1 month

You can’t. You can configure the maximum amount of time for which they will be cached, but Cloudflare can drop them from the cache at any earlier time.

You can use either rule set, though with page rules you need to make sure to specify img.example.com/* as otherwise you’d only cache the root path, which you don’t want.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.