In my previous post I showed how you can very easily add Caching to your application by using Castle Windsor. The example used was a very basic implementation and whilst it can be useful for a large number of cases it didn’t cover the all important cache invalidation. In this post I hope to explain how with a bit of convention over configuration how you can invalidate your cache when an object changes. In the last post I was using the Method name combined with the arguments to build the cache key. Now to allow us to build a cache key that can be used when invalidating the cache the key needs to be related to the Result type. For this I’m going to create a simple interface called IAmCacheable to identify the object we want to cache. public interface IAmCacheable { object Key { get ; } } And make sure the object we want to cache implements this interface. public class Product : IAmCacheable { public object Key { get ; } ...