I'm looking for some convenient way to cache data on disk. Basically a key-value store with expiration and the value being (xml)serialized .
Something that could be used like...
var userCacheId = "3332";
var userData = cache.Retrieve(
userCacheId,
() => readUserDataFromDatabase(userCacheId), // Load delegate if not in cache
TimeSpan.FromMinutes(30)); // expiration time
It should be - Used on a Windows Application - Automatically clean up expired cache entries / free the used disk space - Be thread safe - Allow to remove cache entries by key
Any suggestions on this? Maybe some hip NoSql Database would do exactly that? :)