MCPcopy Create free account
hub / github.com/angular/angular / hasUncacheableCacheControl

Function hasUncacheableCacheControl

packages/common/http/src/transfer_cache.ts:355–367  ·  view source on GitHub ↗
(headers: HttpHeaders)

Source from the content-addressed store, hash-verified

353const UNCACHEABLE_CACHE_CONTROL_DIRECTIVES = new Set(['no-store', 'private', 'no-cache']);
354
355function hasUncacheableCacheControl(headers: HttpHeaders): boolean {
356 const cacheControl = headers.get('cache-control');
357
358 if (!cacheControl) {
359 return false;
360 }
361
362 return cacheControl.split(',').some((directive) => {
363 const directiveName = directive.split('=', 1)[0].trim().toLowerCase();
364
365 return UNCACHEABLE_CACHE_CONTROL_DIRECTIVES.has(directiveName);
366 });
367}
368
369function hasSetCookieHeader(headers: HttpHeaders): boolean {
370 return headers.has('set-cookie');

Callers 2

canUseOrCacheRequestFunction · 0.85

Calls 3

someMethod · 0.80
getMethod · 0.65
hasMethod · 0.65

Tested by

no test coverage detected