Managing XML Files
-
Hello, The site I am working on gets its data from small XML files (a few KB) that are refreshed every minute by external tools. Knowing that multiple users will view pages, I think the best way would be to put them as static XmlDocument objects.
private XmlDocument bodyStatuses = new XmlDocument (myfile));
My first question is: knowing that the file will be refreshed on a regular basis, when is the "new" object actually created (pointing to the new version of the file, with new handle, etc..) ? Can I safely assume that ASP manages that for me ? Second question, in the same vein. When I use the same XmlDocument in multiple instances of a user control placed on the same page, could I also put my XML file as static in the user control ? so that it is only opened once (1st user control), and read once per user control ? I am OK in C#, but new to ASP, so I don't know how such things are handled internally, and I would not want to hinder performances with bad coding habits :) Thanks in advance.