Add Data Caching
Problem
You want to improve Web service performance by caching some data, but you need to reuse cached data among several methods. Or, you want to run your Web method code but still use some cached information.
Solution
Store any object in the cache using the Cache object.
Discussion
Data caching with a Web service works almost exactly the same as the Web page data caching technique described in recipe Store Arbitrary Data in the ASP.NET Cache. In fact, you can store data in the cache using Web page code and retrieve it in a Web service, or vice versa. Data caching supports two types of expiration policy: absolute expiration and sliding expiration. For more information, refer to recipe Store Arbitrary Data in the ASP.NET Cache.
The ...
Get Microsoft® Visual Basic® .NET Programmer's Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.