In CI, many jobs ask for the same packages at the same moment. These changes to git-pkgs/proxy, all merged upstream and released in 0.9.0 and 0.9.1, make it handle that well: each package and metadata document is fetched from the registry once however many jobs ask for it, a cold cache no longer returns errors under load, and cached requests are served at more than twice the throughput, with cached metadata up to 36 times faster.
| Change | Benefit | PR | Merged | Release |
|---|---|---|---|---|
| The file backend no longer writes a metadata sidecar | Reads of an artifact stay reliable while it is being cached | #328 | yes | 0.9.0 |
| Concurrent requests for an uncached artifact share one upstream fetch | Each artifact is fetched from the registry once, however many jobs ask for it at the same moment | #329 | yes | 0.9.0 |
| Stale entries are replaced inside the shared fetch (requested by the maintainer) | A re-published version is refreshed cleanly, with no request removing another's fresh entry | #348 | yes | 0.9.0 |
| Fixed the handler test build on main | Tests and lint pass again for every open PR | #362 | yes | 0.9.0 |
| An eviction pass that cannot evict anything ends | Eviction stays cheap and quiet even when deletes fail | #363 | yes | 0.9.0 |
| Each fetch gets its own storage path (requested by the maintainer; feedback addressed) | Fetches of one artifact from different URLs or digests never touch each other's bytes | #367 | yes | 0.9.0 |
| Cache hits are batched and written once a second | On the integration-cache-proxy testing instance, more than doubles warm-cache throughput on SQLite, from about 1,000 to about 2,300 requests a second. On Postgres it halves database commits and cuts Postgres CPU by about 40% | #383 | yes | 0.9.1 |
| Concurrent requests for the same uncached metadata share one upstream fetch | On the integration-cache-proxy testing instance, cuts upstream metadata requests by about 85% with metadata caching off, and to exactly one per document with it on. Helps Composer most, whose metadata every CI job fetches | #400 | yes | 0.9.1 |
| Expanding Composer's minified metadata copies only the field it changes | Composer metadata is rewritten about a third faster, with identical output | #401 | yes | 0.9.1 |
| Rewritten npm and Composer metadata is cached in memory | Cached metadata requests are 15 to 36 times faster (for example 7.1 ms to 0.38 ms for @babel/core) and allocate almost nothing | #402 | yes | 0.9.1 |