Skip to content

chore: refresh stale Camo cache on PyPI badges#4

Merged
OussemaFr merged 1 commit into
mainfrom
chore/bust-badge-cache
Jun 22, 2026
Merged

chore: refresh stale Camo cache on PyPI badges#4
OussemaFr merged 1 commit into
mainfrom
chore/bust-badge-cache

Conversation

@OussemaFr

Copy link
Copy Markdown
Member

Why

The PyPI version + Python-versions badges in the README still render as "package not found" even though v0.1.0 published successfully. Diagnosis:

Source What it says
`pypi.org/project/socialapis-sdk` HTTP 200 — page exists
shields.io API Returns `{"label":"pypi","message":"v0.1.0"}`
PyPI JSON API Confirms `name: socialapis-sdk, version: 0.1.0`

All three are correct. The stale image is GitHub's Camo proxy (`camo.githubusercontent.com`), which cached the SVG fetched before publication and refuses to revalidate until either:

  1. The Camo cache TTL expires (hours, sometimes a day)
  2. The image URL changes (Camo treats it as a new image)

What changes

This PR swaps the URLs to ones Camo hasn't seen before:

  • PyPI version: `img.shields.io/pypi/v/...` → `badge.fury.io/py/...` (different host, fresh image)
  • Python versions: dropped the `.svg` suffix (URL change forces Camo to re-fetch)

Both new URLs still point at correct PyPI data — clicking the badge still routes to the same project page. Only the embedded image URL is different.

Test plan

After merging:

  • README renders correctly on the GitHub repo page (no longer shows "package not found")
  • Both badges show actual values (`v0.1.0` and `3.10 | 3.11 | 3.12 | 3.13`)
  • Clicking either badge still routes to `https://pypi.org/project/socialapis-sdk/\`

Alternative if this doesn't work

If Camo still serves a stale image after merge, you can manually purge a specific image by:

```bash
curl -X PURGE https://camo.githubusercontent.com/
```

But that requires the exact Camo URL of the cached image. The URL-swap is simpler and works reliably.

The PyPI version + Python-versions badges in the README were rendering
as "package not found" even after v0.1.0 went live, because GitHub's
image proxy (camo.githubusercontent.com) had cached the SVG fetched
before publication and refused to revalidate.

Diagnosis (confirmed before this change):
  - pypi.org/project/socialapis-sdk → HTTP 200
  - shields.io API returns: {"label":"pypi","message":"v0.1.0"}
  - PyPI JSON API confirms version: 0.1.0
  → data is correct everywhere; only Camo was stale

Fix: change the badge URLs so Camo treats them as new images and
re-fetches:
  - PyPI version: img.shields.io/pypi/v/... → badge.fury.io/py/...
    (different host, different image, fresh Camo entry)
  - Python versions: drop the .svg suffix (shields.io serves SVG by
    default; the URL change forces Camo to re-fetch)

Both badges now point at the correct PyPI version/data, just via
URLs Camo hasn't seen before. The functional behavior is identical
— clicking still routes to pypi.org/project/socialapis-sdk.
@OussemaFr OussemaFr merged commit 42cd93a into main Jun 22, 2026
6 checks passed
@OussemaFr OussemaFr deleted the chore/bust-badge-cache branch June 22, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant