On GET requests, the middleware inspects __endpointMeta.cacheTags to
compute cache keys. If a valid (non-expired) cache entry exists, the
cached response is returned immediately (cloned).
Successful mutations (POST, PUT, DELETE, PATCH) invalidate entries whose
tag names start with any of the endpoint's tag names, including all aliases.
Generations also prevent older in-flight reads from repopulating them.
Creates a tag-based cache middleware.
On GET requests, the middleware inspects
__endpointMeta.cacheTagsto compute cache keys. If a valid (non-expired) cache entry exists, the cached response is returned immediately (cloned).Successful mutations (POST, PUT, DELETE, PATCH) invalidate entries whose tag names start with any of the endpoint's tag names, including all aliases. Generations also prevent older in-flight reads from repopulating them.