ASP.NET Cache

If I want to use ASP.NET cache in the code-behind page using System.Web.Caching, I can easily reference the Cache object to .Add, .Get, etc.

If I am writing classes and functions outside of the ASP.NET page scope but still need to reference that cache, I found it helpful to explicitly reference HttpContext.Current.Cache. Otherwise, I was ending up with errors I couldn’t quickly explain.

Leave a Reply

Your email address will not be published.