Implementing caching in ASP.NET 2.0
I'm in the process of adding some caching functionality to my ASP.NET 2.0 project, but can't decide which route to take when it comes to the caching mechanisms to use.
The 2 mechanisms that stand out at the moment are:
1. System.Web.Caching - Seems straight forward and easy to implement.
2. Microsoft.Practices.EnterpriseLibrary.Caching - Looks a bit more complex but with added functionality. I like the idea of a CacheManager.
And then there is the issue to sync across several web farms.
What would be the best way to implement concurrency between server?
These are the 2 possibles i'm playing with at the moment:
1. When something changes on an object, you could set a flag in the Database and check this flag everytime the object is requested from cache.
2. Send a HTTPWebRequest to all servers in a web farm requesting them to update their cache.
Any ideas? Any recommendations? Best practices?
If anybody has some experienced with working on one or perhaps both mechanisms, I would love to hear from you.