I have an xml file that will be read many times from the source code. I would like to know the efficient way in which i can read only once [ during application start ] the xml file and then cache its contents so that i can reuse it efficiently and fastly.
I am using C# 4. Kindly suggest the best practice for efficient caching and reading.
EDIT
Found this resource : CodeProject Article
I have loaded the xml file into an XmlDocument and Cached it using Enterprise Library as follows,
XmlDocument xdoc = new XmlDocument();
xdoc.Load("MyXmlFile.XML");
FileDependency fileDependency=new FileDependency("MyXmlFile.XML");
cacheManager.Add("XConfig", xdoc, CacheItemPriority.Normal, null, fileDependency);