packagist icon indicating copy to clipboard operation
packagist copied to clipboard

Caching issues return old package versions

Open tbradsha opened this issue 2 months ago • 2 comments

When accessing various package metadata (e.g. https://repo.packagist.org/p2/automattic/jetpack-autoloader.json), it sometimes shows outdated information for hours.

It seems #1606 was closed, but the issue remains. In particular, we've had it reported when people are accessing from non-US locations (e.g. Asia/Pacific). Perhaps there's a CDN propagation issue?

As noted in the other issue, adding a cache-buster param or via a proxy shows the updated metadata.


Pure speculation, but perhaps this is happening:

  1. The new version of the package is uploaded, and is recorded as updated as of timestamp X.
  2. A package version check hits some non-primary CDN instance, caching the page at timestamp Y.
  3. The main source propagates out to the CDNs, clearing cached pages of that package that are older than X.

Because the caching on step 2 occurred after X, it isn't auto-purged on step 3.

tbradsha avatar Nov 11 '25 19:11 tbradsha

Please let me know if you get another file like this, then I'll try to report it upstream ASAP. Unfortunately as the issue resolves itself at some point it is very difficult to report this while it is still broken.

Seldaek avatar Nov 12 '25 09:11 Seldaek

If possible upload a HAR file of a failing request, see https://support.zendesk.com/hc/en-us/articles/4408828867098-Generating-a-HAR-file-for-troubleshooting

You can then append ?cachebuster to then fetch again the latest content and get both requests in the HAR file ideally.

Seldaek avatar Nov 12 '25 10:11 Seldaek

I think I'm also getting this issue within in the last half hour for a different package. I'm located in Australia.

I've captured 3 HAR files:

  • AUS, showing v1.31
  • AUS with ?cachebuster, showing v1.32
  • US via VPN, showing v1.32

repo.packagist.org_p2_karmabunny_rdb.json_.zip

gwillz avatar Dec 16 '25 03:12 gwillz

Awesome thanks @gwillz I'll forward that over.

Seldaek avatar Dec 16 '25 09:12 Seldaek

Ok so same as usual, cache purging queue backed up on the CDN issues causing a delay in cache busting. They told me they should roll out a fix for this recurring issue later this week though, so let's hope it stops happening.

Seldaek avatar Dec 16 '25 10:12 Seldaek