MCPcopy Create free account
hub / github.com/nodejs/undici / revalidationResponseDisallowsCachedReuse

Function revalidationResponseDisallowsCachedReuse

lib/handler/cache-handler.js:477–481  ·  view source on GitHub ↗

* @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions['type']} cacheType * @param {import('../../types/header.d.ts').IncomingHttpHeaders} resHeaders * @param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives} cacheControlDirectives * @returns {bool

(cacheType, resHeaders, cacheControlDirectives)

Source from the content-addressed store, hash-verified

475 * @returns {boolean}
476 */
477function revalidationResponseDisallowsCachedReuse (cacheType, resHeaders, cacheControlDirectives) {
478 return cacheControlDirectives['no-store'] === true ||
479 (cacheType === 'shared' && cacheControlDirectives.private === true) ||
480 (resHeaders.vary ? isInvalidOrWildcardVaryHeader(resHeaders.vary) : false)
481}
482
483/**
484 * @see https://www.rfc-editor.org/rfc/rfc9111.html#name-storing-responses-to-authen

Callers 1

onResponseStartMethod · 0.70

Calls 1

Tested by

no test coverage detected