项目作者: patryk-kawalarz

项目描述 :
Angular interceptor to cache all http requests.
高级语言: TypeScript
项目地址: git://github.com/patryk-kawalarz/cache-interceptor.git
创建时间: 2020-12-09T09:44:31Z
项目社区:https://github.com/patryk-kawalarz/cache-interceptor

开源协议:

下载


Angular cache interceptor

This interceptor caches are all http requests for 60 minutes and stores them in IndexedDB using localForage.

Installation

Add cache.interceptor.ts to your project. Put this in your app.module.ts file:

  1. import { CacheInterceptor } from './services/cache.interceptor'
  2. @NgModule({
  3. providers: [
  4. { provide: HTTP_INTERCEPTORS, useClass: CacheInterceptor, multi: true }

Dependencies

MomentJS, localForage