Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 601 Bytes

README.md

File metadata and controls

17 lines (12 loc) · 601 Bytes

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:

import { CacheInterceptor } from './services/cache.interceptor'

@NgModule({
  providers: [
    { provide: HTTP_INTERCEPTORS, useClass: CacheInterceptor, multi: true }

Dependencies

MomentJS, localForage