ASP.NET cache add vs insert
Solution 1:
Insert
will overwrite an existing cached value with the same Key; Add
fails (does nothing) if there is an existing cached value with the same key. So there's a case for saying you should always use Insert since the first time the code runs it will put your object into the cache and when it runs subsequently it will update the cached value.
Solution 2:
Cache.Add()
also returns a cached object from Cache
after it was added:
string cachedItem = Cache.Add("cachedItem", ....);