kinetex - v1.0.0-rc.1
    Preparing search index...

    Function createCacheInterceptor

    • Create a cache interceptor with LRU eviction and stale-while-revalidate support. Only caches GET and HEAD by default.

      Parameters

      • config: Partial<CacheConfig> = {}

        Cache configuration (defaults used for omitted fields)

      Returns {
          requestInterceptor: RequestInterceptorFn;
          responseInterceptor: ResponseInterceptorFn;
          store: Map<string, CacheEntry>;
      }

      • requestInterceptor: RequestInterceptorFn

        Serves cached responses and attaches conditional headers for revalidation

      • responseInterceptor: ResponseInterceptorFn

        Caches successful responses and handles 304 revalidation

      • store: Map<string, CacheEntry>

        Direct access to the underlying cache store