replacing Images

Open
#663 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
backend, cloud

Research direction

First check whether users are seeing stale images after replacements, especially Creator images or brand emblems; the issue presents cache purging as conditional on this becoming a problem. Read the Cloudflare cache purge API documentation linked in the issue and trace the image replacement and image-cache paths. Done would mean agreeing on when purging is needed and implementing and verifying it for those cases; the issue does not name files or tests.

Written by the indexing model from the issue text.

Description

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)
Dominant language
Python
Stars
122
Forks
36
Avg merge
2d 16h
Merged PRs (30d)
28

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GrandComicsDatabase/gcd-django

All issues in GrandComicsDatabase/gcd-django

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.