How to enable caching in $http service?



How to enable caching in $http service?..

Answer / chaitanya

You can enable caching in $http service by setting configuration property cache to true. When cache is enabled, $http service stores the response from the server in local cache. In this way, next time the response will be served from the cache without sending request to server. $http.get("http://server/myserviceapi",{ cache:true }).sucess(function(){ //TO DO: });

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More AngularJS Interview Questions

What is the forroot method in angular4?

0 Answers  


What is angular singleton service?

0 Answers  


Can digest cycle be forced to run manually?

0 Answers  


What is the aot compilation?

0 Answers  


What is afterviewinit?

0 Answers  


Explain what is injector in angularjs?

0 Answers  


Explain currency filter and when to use it?

0 Answers  


Why does angular need an entrycomponents?

0 Answers  


What is $sce?

0 Answers  


What is ivy rendering engine in angular 7?

0 Answers  


What is @injectable in angular?

0 Answers  


What is a service angular?

0 Answers  


Categories