Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache Invalidation #933

Open
oravecz opened this issue Nov 25, 2024 Discussed in #920 · 0 comments
Open

Cache Invalidation #933

oravecz opened this issue Nov 25, 2024 Discussed in #920 · 0 comments

Comments

@oravecz
Copy link

oravecz commented Nov 25, 2024

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.

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

No branches or pull requests

1 participant