I am debugging an application that uses an XML file to store data as key/value pairs.
Every pageload the XML file is parsed to populate a Dictionary collection with these key/value pairs. The Dictionary is then used to look up values based on their keys.
Is this method of loading data from an XML file on every page load a good practice?
Here are some thoughts:
- Should the XML data be stored in a database table instead?
- Should I work with a collection or hit the database for every lookup request?
- Could the collection be loaded on application start and set as a global/application property?
What do you guys think?
I would suggest loading the results of the XML Parsing into the ASP.NET Cache: