Silent Cache Bug Fixed in npmx.dev That Froze npm Package Version Displays

A bug in npmx.dev, a browser for the npm registry, was causing package version comparisons to display outdated data — for example, showing tinyclip at version 0.0.1 instead of the actual latest 0.1.8. The root cause was traced to a composable called useCachedFetch, where the client branch hardcoded the browser fetch option cache: 'force-cache', which ignores server cache headers and serves a frozen local copy indefinitely. The npm registry already sends correct Cache-Control headers with a 300-second max-age and ETag support, meaning the app was simply not honoring them. The fix replaced 'force-cache' with 'default' in two locations, instructing the browser to follow standard HTTP caching rules instead. The change passed all 1,000-plus existing unit tests and was submitted as pull request #3156, resolving the originally reported issue #1832.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in