Skip to content

docs: bust the cached PyPI badge - #2

Merged
hchittanuru3 merged 1 commit into
mainfrom
fix/pypi-badge-cache
Aug 14, 2026
Merged

docs: bust the cached PyPI badge#2
hchittanuru3 merged 1 commit into
mainfrom
fix/pypi-badge-cache

Conversation

@hchittanuru3

Copy link
Copy Markdown
Contributor

The version badge renders "package or version not found" even though the package published fine.

shields had the data the whole time. Its JSON route returns the right answer while the SVG route serves a stale negative:

GET /pypi/v/postflight.json  ->  {"message":"v0.1.0"}          correct
GET /pypi/v/postflight       ->  "package or version not found"  cached

The negative was seeded when that exact URL was fetched before the package existed.

?cacheSeconds=300 is a different URL, so it misses the stale entry, and it caps future staleness at five minutes instead of whatever shields defaults to. It also produces a new camo URL, which matters independently: GitHub's image proxy had cached the broken image too, and would have kept serving it after shields recovered.

Verified both forms return pypi: v0.1.0.

Applied to pyversions as well. It renders correctly today (3.11 | 3.12 | 3.13 | 3.14) but would go stale the same way whenever the supported range changes.

The CI badge was never broken, for the record: it returns <title>tests - passing</title>.

The version badge rendered "package or version not found" after publishing. shields had
the data all along: its JSON route returned v0.1.0 while the SVG route served a cached
negative, seeded when that exact URL was fetched before the package existed.

cacheSeconds=300 is a new URL, so it misses the stale entry, and it caps future staleness
at five minutes rather than whatever shields defaults to. A new URL also means a new camo
URL, so GitHub's image proxy cannot keep serving the old one either.

Applied to pyversions as well. That one renders correctly today but would go stale the
same way on a change to the supported range.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hchittanuru3
hchittanuru3 merged commit 077c97d into main Aug 14, 2026
5 checks passed
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