title: How to cache web service results in C# / MVC instead of calling web service all the time
body: <p>I'm building a <em>small</em> web application which essentially will be used to call an external REST/JSON Web service, pass some parameters and return the results of this to the user in a table.</p>
  
  <p>I know that the data from this external service will not change often (maybe once a day) and I want to prevent calling the web-service lots of times for the same query.</p>
  
  <p>What would be a good way to implement some sort of caching?</p>
  
  <p>At the moment I put together something (which sort of works, but i don't think is the correct way):</p>
  
  <ol>
  <li><p>User enters search parameters</p></li>
  <li><p>Try { LINQ Query to select results from a List }</p></li>
  <li><p>Catch { Call the webservice, populate the List with results and then re-run the LINQ query. If still no results again then throw exception}</p></li>
  </ol>
  
  <p>I guess I would empty the List at the end of the day so each day it will rebuild.</p>
  
  <p>The code is a bit messy but seems to work <em>most</em> of the time - is there any better way to achieve this?</p>