How to enable caching in $http service?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is bazel and closure compiler in angular6?

462


What is json web token in angularjs?

431


Why is it called angular?

397


What is linking function? What are post linking and pre-linking functions?

459


Why angular is needed?

387






Which is better angular material or bootstrap?

418


Why do we use angular 2?

459


What is $scope? How does it work?

424


List out the differences between config and run methods in angularjs?

527


How to install karma using npm?

437


What are angular providers?

380


What is The Manual Bootstrap Process in AngularJS?

478


What is angular and why angular?

437


What is the use of arrow function in angular 2?

410


Does google own angular?

451