Skip to content

Log rewritten npm tarball URLs once per document - #538

Merged
andrew merged 1 commit into
git-pkgs:mainfrom
simonchrz:fix/npm-rewrite-log
Oct 21, 2026
Merged

andrew merged 1 commit into
git-pkgs:mainfrom
simonchrz:fix/npm-rewrite-log

Conversation

@simonchrz

Copy link
Copy Markdown
Contributor

With debug logging on, the npm handler logged rewrote tarball URL once for every version in a packument. A package with a few hundred versions produced a few hundred lines per document, and with cooldown enabled the rewrite cache is bypassed, so that happened on every request.

It now logs one line per document instead, rewrote tarball URLs with the package and a count. The old and new URL per version are dropped; the new one is always {proxy}/npm/{package}/-/{file}.

A test checks that a three-version packument logs one line with count=3.

The npm handler logged a debug line for every version whose tarball URL
it rewrote. Packages with hundreds of versions produced hundreds of lines
per packument, and with cooldown enabled, where the rewrite cache is
bypassed, again on every request. It now logs one line per document with
the number of rewritten URLs.
@andrew
andrew merged commit ed77e40 into git-pkgs:main Oct 21, 2026
6 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.

2 participants