|Number of votes:||0|
I have been poking around in System.Runtime.Caching that was introduced with .NET 4, and more specifically the MemoryCache.
The MemoryCache is virtually the same as the good old ASP.NET Cache, except it’s not dependent on System.Web which means you can use it without an HttpContext.
ChangeMonitors monitors changes in the state of data which a cache item depends on, and I’ve written a simple custom ChangeMonitor called PageChangeMonitor to monitor published EPiServer pages.
The PageChangeMonitor can be used to expire the cache item when a certain page is published. An example:
Enjoy! And remember – cache is king.