Description
Discussed in #920
Originally posted by oravecz November 20, 2024
This question revolves around the fetching of a package using semantic versioning. When I deploy a new version of my package, I have to wait for the default 10 minute timeout of the server (soon to be exposed as npmQueryCacheTTL
) in order for the updates to the semantic versions to be served.
I would like to be able to invalidate the cache via API.
I would suggest that support for a ?invalidate query parameter be added to the API, which would clear the cache entry for any semver URLs associated with the current request.
For example, if I make a request for https://esm.sh/mypackage/1.2.0?invalidate, the server would Identify the cache entries for /package/1.2.x and /package/1.x and /package and remove them.
Also, for cases where the server is proxied by a CDN provider, the invalidate should purge the CDN cache as well.