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 |
What are the fundamentals concepts of angular 2?
What is provider in angularjs?
What is @inject()? Why use?
What angular components can be defined within AngularJS templates?
What is single page application (spa)?
Explain factory methods in angularjs?
What are the life cycle hooks order in angularjs?
What are different ways to create service in AngularJS?
When should you use an attribute versus an element?
What is the singleton pattern? How does angular use it?
What are typescript types? In detail?
What is router-link directive in angular 2?