I'm looking to add caching to a Windows desktop application written in C# 4.

My requirements are for a persistent key-value store that saves to an encrypted file. I am trying to cache remote calls to a server that are potentially slow—and may cache a considerable amount of data, i.e. 50+ MB. I would like to be able to set a max-file-size value with some form of LRU expiration.

I had thought of serialising a dictionary, but this is likely to be a little slow to initialise, and will have too large a memory footprint.

I'm thinking an encrypted SQLCE 4 database might be the best solution, but this seems heavyweight when I really just want a single hash table. It also doesn't natively offer the caching type features of expiration etc..

Can anyone suggest anything else worth considering, or some suggestion around optimising the serialisation/deserialisation.