I am creating a small web application that will essentially be used to call an external REST / JSON web service, passing some parameters and returning the results of this to the user in a table.
I know that the data from this external service will not change often (perhaps once a day), and I want to call the web service many times over for the same request.
What would be a good way to implement some kind of caching?
At the moment, I have compiled something (which works, but I don't think this is the right way):
User enters search parameters
Try {LINQ Query to select results from the list}
Catch {Call the web service, fill out the results list, and then rerun the LINQ query. If there are still no results, then throw an exception}
I think I would clear the List at the end of the day so that it is rebuilt every day.
The code is a bit dirty, but it seems to work most of the time - is there a better way to achieve this?
Steve source share