angular-http-cache
angular-http-cache copied to clipboard
Should it be working for HttpClient?
I'm always getting the requests, shouldn't been getting from cache instead my external api?
import { HttpClient } from '@angular/common/http'
protected _get(action: string = '', params: string = ''): Observable<Object> {
this.host = `${this.env.host}`;
return this.http.get(`${this.host}${action}${params}`);
}
angular: 5.2.0
ng-http-cache: 1.2.0
Hello there @rochapablo, are all three of your URL parameters identical between requests (this.host, action, and params)? The URL you pass in is the cache's key, so any tiny change to that URL will cause it to re-execute the request.