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ā€¢3mo ago
i think i ended up disabling the cache all together šŸ˜©
Idle
Idleā€¢3mo 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ā€¢3mo ago
oh fr? šŸ˜­ i did try making cf respect my origin but it doesnt work
Idle
Idleā€¢3mo ago
you need to explicitly do that in your cache rules
CatNoir
CatNoirOPā€¢3mo ago
oh wait, if theres no ttl, does it cache for a long time? oh
Idle
Idleā€¢3mo 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ā€¢3mo ago
i see im guessing youre talking about "max-age" header right?
Idle
Idleā€¢3mo ago
yep
CatNoir
CatNoirOPā€¢3mo ago
i see ill set it to 5 minutes (300)
Want results from more Discord servers?
Add your server