[GrandComicsDatabase/gcd-django] replacing Images (Issue #663)

13 views
Skip to first unread message

JochenGCD

unread,
Jun 10, 2025, 5:46:46 AMJun 10
to GrandComicsDatabase/gcd-django, Subscribed
jochengcd created an issue (GrandComicsDatabase/gcd-django#663)

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.Message ID: <GrandComicsDatabase/gcd-django/issues/663@github.com>

Reply all
Reply to author
Forward
0 new messages