colinramsay.co.uk

HttpContext vs HttpRuntime

07 Feb 2006

I never knew this, but apparently you can access the ASP.NET cache through either HttpContext.Current.Cache or through HttpRuntime.Cache, and HttpRuntime is actually faster.

Peter Johnson also highlights a second benefit in his blog entry on the subject - HttpRuntime is available at all times, so you can use it in unit testing!

Feedback or questions on this post? Create an issue on GitHub.