When replacing images, the cache at Cloudflare keeps these for a bit longer, be it the full file, be it the processed versions via imagekit in the image-cache.
We could purge the Cloudflare cache for these occasions, if it becomes an issue noticed by users, e.g. when updating Creator images, or brand emblems.
https://developers.cloudflare.com/api/python/resources/cache/methods/purge/
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted
api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted
)
response = client.cache.purge(
zone_id="zone_id",
)
print(response.id)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.