🧠
ngx-crud
  • Introduction
  • API
    • HTTP Operations
    • HTTP Aborting
    • HTTP Caching
    • HTTP Observing
    • HTTP Options
    • HTTP Context
    • HTTP Headers
    • HTTP Params
    • Service Instance
    • Service Options
  • Reference
    • Modules
      • AbortModule
      • CacheModule
      • ObserveModule
      • CrudModule
    • Services
      • AbortService
      • CacheService
      • CommonService
      • CrudService
      • CustomService
      • DeleteService
      • FindService
      • GetService
      • ObserveService
      • PatchService
      • PostService
      • PutService
    • Interceptors
      • AbortInterceptor
      • CacheInterceptor
      • ObserveInterceptor
    • Decorators
      • @ApiUrl
      • @ApiRoute
    • Helpers
      • createUrl
      • createUrlWithId
      • stripUrlParams
  • Examples
    • Services
      • Fully Typed Collection
      • Limited Singleton
    • Components
      • Loader
    • Effects
      • ProfilerEffect
      • ErrorEffect
      • OfflineEffect
  • Links
    • GitHub
Powered by GitBook
On this page
  • Switch
  • Flush
  • Observe
  1. API

HTTP Caching

Switch

Enable caching for the service:

crudService.enableCache(method : UniversalMethod = 'GET', lifetime : number = 2000) : this

Disable caching for the service:

crudService.disableCache() : this

Flush

Flush all caches of the service:

crudService.flush() : this

Flush a single cache by its urlWithParams for enabled services:

cacheService.flush(urlWithParams : string) : this

Flush many caches by their url for enabled services:

cacheService.flushMany(url : string) : this

Flush all caches for enabled services:

cacheService.flushAll() : this

Observe

Observe a single cache by its urlWithParams for enabled services:

cacheService.observe(urlWithParams : string) : Observable<[string, Store]>

Observe many caches by their url for enabled services:

cacheService.observeMany(url : string) : Observable<[string, Store]>

Observe all caches for enabled services:

cacheService.observeAll() : Observable<[string, Store]>
PreviousHTTP AbortingNextHTTP Observing

Last updated 2 years ago