Reactive Caching of HTTP Service
问题 I am using RsJS 5 (5.0.1) to cache in Angular 2. It works well. The meat of the caching function is: const observable = Observable.defer( () => actualFn().do(() => this.console.log('CACHE MISS', cacheKey)) ) .publishReplay(1, this.RECACHE_INTERVAL) .refCount().take(1) .do(() => this.console.log('CACHE HIT', cacheKey)); The actualFn is the this.http.get('/some/resource') . Like I say, this is working perfectly for me. The cache is returned from the observable for duration of the RECACHE