Skip to content
@ng-doc/ui-kit / Class

NgDocCacheInterceptor

Caches GET responses of requests that opt in with the NgDocCacheInterceptor.TOKEN query parameter. The parameter is removed before the request is sent, and every later request for the same URL shares the first response. A failed request is not cached.

It only runs when the application's HttpClient uses interceptors from DI (withInterceptorsFromDi()). NgDoc's icons no longer depend on it: they are cached by NgDocIconRegistry.

Decorators
@Injectable
Implements
HttpInterceptor
DeclarationTypeScript
@Injectable()
export class NgDocCacheInterceptor implements HttpInterceptor { … }

Members

Static Properties

1
TOKEN: string
staticreadonly

Name of the query parameter that marks a request as cacheable.

Methods

1
(…): Observable<HttpEvent<T>>
implements HttpInterceptor

Returns the cached response for opted-in GET requests and passes every other request on.

Symbol
Kind
Class
Decorators
@Injectable
Implements
HttpInterceptor
Scope
@ng-doc/ui-kit
Edit this page