How CDN manages cache storage when is full

Hello, I’m currently serving about 30GB/day with cloudflare’s CDN, and I’m aware of my account cache storage limit of 512MB.

This bandwith consists in a huge ammount of static jpg files. 1% of them are heavily consumed (common stuff that everyone sees every time), and the rest are product images, that depend on what the user is searching. These files are in different folders of the same domain.

All of my files are static, never change, are stored in AWS S3 and have a cache-control: max-age=31536000. I also configured a Page Rule to cache everything with an Edge TTL of 1 month.

My issue is that I’m having a lot of bandwith consumed in S3 regarding cloudflare’s missed-cache requests.

I know that Cloudflare won’t be able to store all of my files everytime because of the 512MB limit, so I want to understand how Cloudflare’s manages accounts with no free storage.
Does it use an algorythm like LRU to replace files? Or it won’t replace any file until it’s TTL expires?

How can I optimize caching so my 1% most requested files are always served with the CDN and never removed from there, and the other 99% be also served by the CDN but be able to be removed when needed

Thank you in advance

After reminders from @matteo and @judge, that 512MB storage limit is max filesize. Total cache is much larger.

As for how Cloudflare handles the cache itself, it’s completely in their hands, regardless of how high you set Edge Cache TTL:


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