In my application I have used a generic handler to serve requests.
I want a mechanism like, if the first time request comes to the handler, it makes a request to the server and then caches the whole datatable, so for upcoming requests if the next requested productcode exists in the cached datatable, it should not go to the server for fetching data again; it should check the data of the cached datatable only.
How can I set up a datatable in the cache?
Something along these lines?
You’re going to need some mechanism to flush the data table from the cache if it changes. For example you could use an SqlCacheDependency.
As requested, to clear the cache an hour after the table is added you would do: