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 router-outlet directive in angular?

0 Answers  


What is route guards?

0 Answers  


Why angular material is used?

0 Answers  


Can we use angularjs in android?

0 Answers  


What is a factory?

0 Answers  


What is angular mainly used for?

0 Answers  


Explain angular elements?

0 Answers  


Explain the procss about angular project bootstrap?

0 Answers  


How angular 4 is different from angular 2?

0 Answers  


How does a shaking tree work?

0 Answers  


Please explain system.config.ts file used in angular?

0 Answers  


How can we fix it?

0 Answers  


Categories