CacheInterceptor

  
class CacheInterceptor implements NestInterceptor {
  protected httpAdapterHost: HttpAdapterHost
  protected allowedMethods: ['GET']
  protected cacheManager: any
  protected reflector: Reflector
  intercept(context: ExecutionContext, next: CallHandler): Promise<Observable<any>>
  protected trackBy(context: ExecutionContext): string | undefined
  protected isRequestCacheable(context: ExecutionContext): boolean
  protected setHeadersWhenHttp(context: ExecutionContext, value: any): void
}

See also

Properties

Property Description
protected httpAdapterHost: HttpAdapterHost Read-only.
protected allowedMethods: ['GET']
protected cacheManager: any Read-only.
protected reflector: Reflector Read-only.

Methods

intercept()


intercept(context: ExecutionContext, next: CallHandler): Promise<Observable<any>>

Parameters

Option Type Description
context ExecutionContext
next CallHandler

Returns

Promise<Observable<any>>

trackBy()


protected trackBy(context: ExecutionContext): string | undefined

Parameters

Option Type Description
context ExecutionContext

Returns

string | undefined

isRequestCacheable()


protected isRequestCacheable(context: ExecutionContext): boolean

Parameters

Option Type Description
context ExecutionContext

Returns

boolean

setHeadersWhenHttp()


protected setHeadersWhenHttp(context: ExecutionContext, value: any): void

Parameters

Option Type Description
context ExecutionContext
value any

Returns

void