title: AngularJS: How can I cache json data returned from $http call?
body: <p>How can I cache json data returned from $http call. I use the following style of $http call:</p>
  
  <pre><code>$http({
          url: 'SomeWebMethodUrl',
          method: "POST",
          data: "{'query':'somevalue'}",
          headers: { 'Content-Type': 'application/json' }
      }).success(function (data, status, headers, config) {
          //something in success
      }).error(function (data, status, headers, config) {
          //something in error
      });
  </code></pre>
  
  <p>I looked at the following tutorial: <a href="https://coderwall.com/p/40axlq" rel="noreferrer">https://coderwall.com/p/40axlq</a> on caching server response from $http call. But it is explaining $http.get() style and will cache data and will not make second $http request if the absolute URL is same.</p>
  
  <p>Can I use caching with my style of $http call when my 'data' property is same for same webmethod calls in future? I am using ASP.net ASMX webservice for my WebMethods.</p>