Is it possible to have a HashTable that automatically removes the oldest accessed element from the list? I’m trying to build a validation cache but I’m concerned about the possibility that I could be bombarded with requests and my Hashtable getting too big in memory. I looked into the size, but sounds like the cache automatically doubles in size when the treshold is reached. Of course, the other option is to just build queue or stack in memory but that wouldn’t be efficient for lookups.
Is there a better way to maintain a cache in memory? My table would be pretty simple, storing a string and a bool against it. Any other ideas?
Thanks,
kosh
Use System.Web.Caching.Cache instead.