Skip to content

Cache Invalidation #933

Open
Open
@oravecz

Description

@oravecz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions