angular cache is a library that help to cache data on client. the purpose is to reduced request count to api from angular application
npm install angular-cache-rfangular cache is a library that help to cache data on client. the purpose is to reduced request count to api from angular application
npm i angular-cache-rf
use AngularCacheService for using this library.
export class SampleService{
constructor(private angularCacheService: AngularCacheService){
}
cacheThisData(){
this.angularCacheService.GetCache(Observable, key)
}
GetCache will return data as observable. It has some options
* ExpiresDate: time to expired
* Location: place to save cache (localstorage or session storage
#### Expires Date
you can use DateExtension class to help you for set value for this option. DateExtensionhave some method
* AddMinutes
* Addsecond
* AddHour
* AddDay
#### Location
use AngularCacheSessionType to choose cache location