Caching HttpResponse in Angular

Publié le: 10 janvier 2018
sur la chaîne: Techie Ocean
15,050
111

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


Sur cette page du site, vous pouvez voir la vidéo en ligne Caching HttpResponse in Angular durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Techie Ocean 10 janvier 2018, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 15,050 fois et il a aimé 111 téléspectateurs. Bon visionnage!