In this tutorial, We will see how to implement caching of Http Reponse in Angular 4 using Interceptors.
In many cases, in your Angular Application there are some API's which are called frequently and whose data is not undergoing any changes.
Now calling the server API again and again can cause a code performance issue.
So we need some kind of mechanism in which we can cache the httpresponse for that particular httprequest.
So when the first time the API is called its response is stored in the cache using interceptor for that particular request.
And now when the second time, the APi is called for that same http request then the httpresponse is been fetched from the cache instead of
going to the server for bringing the data.
So this can help a lot in code performance.
We also have to note that ONLY and ONLY the API's whose response does'nt change frequently should only be cached. Also the API's regarding Authentication should NOT be cached.
So we have to handle these conditions in the cache interceptor where we are implementing the caching.
This tutorial is the continuation of the previous tutorial for Multiple Interceptors in Angular 4
Here is the Link :
• Multiple Interceptors in Angular
#Angular #Angular 8 #Angular7 #Angular 6 #Angular 5
On this page of the site you can watch the video online Caching HttpResponse in Angular with a duration of hours minute second in good quality, which was uploaded by the user Techie Ocean 10 January 2018, share the link with friends and acquaintances, this video has already been watched 15,050 times on youtube and it was liked by 111 viewers. Enjoy your viewing!