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

Function revalidationResponseDisallowsCachedReuse

lib/handler/cache-handler.js:491–498  ·  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

489 * @returns {boolean}
490 */
491function revalidationResponseDisallowsCachedReuse (cacheType, resHeaders, cacheControlDirectives) {
492 return cacheControlDirectives['no-store'] === true ||
493 (cacheType === 'shared' && (
494 cacheControlDirectives.private === true ||
495 Object.hasOwn(resHeaders, 'set-cookie')
496 )) ||
497 (resHeaders.vary ? isInvalidOrWildcardVaryHeader(resHeaders.vary) : false)
498}
499
500/**
501 * @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