Help with cache

When a user deletes an image from my server, it can still be viewed because of cloudflare cache. When I click on the purge cache button on cloudflare, the image is removed. Is there anyway to fix this behaviour without removing caching? is there anyway i could send a signal to cloudflare automatically to remove the cache?
10 Replies
CatNoir
CatNoirOPā€¢2mo ago
i think i ended up disabling the cache all together šŸ˜©
Idle
Idleā€¢2mo ago
https://developers.cloudflare.com/api/operations/zone-purge or just... have cf respect your origins cache ttl and serve the image with a low ttl? using the cdn for image storage without a corresponding plan is also against cf tos i think
CatNoir
CatNoirOPā€¢2mo ago
oh fr? šŸ˜­ i did try making cf respect my origin but it doesnt work
Idle
Idleā€¢2mo ago
you need to explicitly do that in your cache rules
CatNoir
CatNoirOPā€¢2mo ago
oh wait, if theres no ttl, does it cache for a long time? oh
Idle
Idleā€¢2mo ago
if you don't provide a ttl then cf will use its default ttl or any other ttl that is set in your cache rule
CatNoir
CatNoirOPā€¢2mo ago
i see im guessing youre talking about "max-age" header right?
Idle
Idleā€¢2mo ago
yep
CatNoir
CatNoirOPā€¢2mo ago
i see ill set it to 5 minutes (300)
Want results from more Discord servers?
Add your server