This is a wrapper around HttpRuntime.Cache i use when some object is to expensive to get from its source every time. For example a RSS-feed which might only need to get updates from its source every minute.
This code shows how to add and remove a string from the cache. If it’s not removed it will stay there for 4 hours which is set in the contstructor of HttpRuntimeCache class.
Change cache expiration
To change the expiration the Expiration property can be set before adding the object to the cache:
I hope you find this post valuable. If you click the ad below I get paid by someone else and can continue to publish posts for free. I would appreciate it very much.