top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to enable caching in $http service?

0 votes
265 views
How to enable caching in $http service?
posted Nov 11, 2017 by Latha

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

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:
});
answer Nov 11, 2017 by Shivaranjini
...