MCPcopy Index your code
hub / github.com/angular/angular / withHttpTransferCache

Function withHttpTransferCache

packages/common/http/src/transfer_cache.ts:439–468  ·  view source on GitHub ↗
(cacheOptions: HttpTransferCacheOptions)

Source from the content-addressed store, hash-verified

437 *
438 */
439export function withHttpTransferCache(cacheOptions: HttpTransferCacheOptions): Provider[] {
440 return [
441 {
442 provide: CACHE_OPTIONS,
443 useFactory: (): CacheOptions => {
444 performanceMarkFeature('NgHttpTransferCache');
445 return {isCacheActive: true, ...cacheOptions};
446 },
447 },
448 {
449 provide: HTTP_ROOT_INTERCEPTOR_FNS,
450 useValue: transferCacheInterceptorFn,
451 multi: true,
452 },
453 {
454 provide: APP_BOOTSTRAP_LISTENER,
455 multi: true,
456 useFactory: () => {
457 const appRef = inject(ApplicationRef);
458 const cacheState = inject(CACHE_OPTIONS);
459
460 return () => {
461 appRef.whenStable().then(() => {
462 cacheState.isCacheActive = false;
463 });
464 };
465 },
466 },
467 ];
468}
469
470/**
471 * This function will add a proxy to an HttpHeader to intercept calls to get/has

Callers 2

resource_spec.tsFile · 0.90

Calls 4

injectFunction · 0.90
performanceMarkFeatureFunction · 0.85
thenMethod · 0.65
whenStableMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…