Skip to content

Cache-bust the PyPI badge URL - #37

Merged
NCCU-Schultz-Lab merged 1 commit into
mainfrom
readme-badge-cachebust
Jul 31, 2026
Merged

Cache-bust the PyPI badge URL#37
NCCU-Schultz-Lab merged 1 commit into
mainfrom
readme-badge-cachebust

Conversation

@NCCU-Schultz-Lab

Copy link
Copy Markdown
Collaborator

The PyPI badge rendered as "package or version not found" even after quantui
0.5.1 published successfully.

Not a packaging problem. Verified before changing anything:
pypi.org/pypi/quantui/json returns 200 with version 0.5.1, and
img.shields.io/pypi/v/quantui.json already reported "v0.5.1" — the origin
was correct the whole time.

Two independent stale caches, both holding a genuine 404 from before the
package existed:

  • shields.io caches badge results for 3h (max-age=10800) behind
    Cloudflare. That badge URL was first requested when the README rendered
    during the pre-flight metadata work — well before anything was published, so
    the 404 was real at the time and got cached.
  • GitHub's camo proxy. GitHub never lets a browser hit shields.io directly;
    it proxies README images through camo.githubusercontent.com, which cached
    its own copy of that stale SVG and doesn't track the origin's cache headers.

Appending ?v=2 makes camo treat it as a new image and fetch fresh. Bump the
number again if it ever recurs.

Would have self-corrected within ~3h anyway; this just forces it now.

🤖 Generated with Claude Code

The badge rendered as "package or version not found" even after quantui 0.5.1
published successfully. Not a packaging problem — two independent stale
caches, both holding a genuine 404 from before the package existed:

  - shields.io caches badge results for 3h (max-age=10800) behind Cloudflare.
    The badge URL was first requested when the README was rendered during the
    pre-flight metadata work, well before anything was published.
  - GitHub never lets a browser hit shields.io directly; it proxies README
    images through camo.githubusercontent.com, which cached its own copy of
    that stale SVG and doesn't track the origin's cache headers.

Appending ?v=2 makes camo treat it as a new image and fetch fresh. Bump the
number again if this ever recurs.

Verified before changing anything: pypi.org/pypi/quantui/json returns 200 with
version 0.5.1, and img.shields.io/pypi/v/quantui.json already reported
"v0.5.1" — the origin was correct the whole time.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@NCCU-Schultz-Lab
NCCU-Schultz-Lab merged commit f4b5389 into main Jul 31, 2026
5 checks passed
@NCCU-Schultz-Lab
NCCU-Schultz-Lab deleted the readme-badge-cachebust branch July 31, 2026 21:50
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