A strange experience it was; losing data from the Asp.net cache.
I was refactoring some code which was used frequently in my Asp.net code, and all it did was getting a non-volatile list of items from the database. A good candidate for some caching I thought.
So I created the caching code, hit F5 and started the program.
And guess what? All new errors occurred.
While debugging I found out that the first moment I put in ten items for the cachekey, and later on I only got five out when I asked for the same data.
So what is this? A bug in the cache in .Net?
Most likely not, so I investigated the rest of the code.
And what turned out to be the case?
One function getting the data from the cache actually removed items from the list.
That is perfectly ok if the next code gets a fresh result from the database, but not if the items are removed from a list which is actually in cache.