title: Caching json response from server and automatically detect when the data is changed
body: <p>I am working on an angular app , which makes calls to a server and gets JSON data. I am looking at caching this JSON data. </p>
  
  <p>Approach tried : </p>
  
  <p>1) I tried using the html5 localSorage , to save the data locally. But , the problem with this is , i should manually set an expiration time and there is no way of knowing how occasionally the data will change. </p>
  
  <p>2) I have tried using the $cacheFactory , however this does not cache data across refreshes or page navigations. </p>
  
  <p>Solution I am looking for , </p>
  
  <p>I want the data to be saved locally or cached. And use some mechanism to detect if the data returned by the server has changed (JSON data) and only then make a call. </p>
  
  <p>Is this possible in any way ? </p>