I need to cache an xml that I am reading. I’m using C# 4.0. Can someone please suggest the most elegant/ best way to cache the xml file. The cached file needs to be a singleton but the wrapper should probably be a transisent lifestyle.
many thanks,
James
Since this is a class library you could use a
MemoryCacheinstance:This adds the overhead of having to keep track of the memory cache, but it allows you to easily specify a retention period and load the XML if required: