I have an Asp.Net MVC web application, with an xml configuration file that has about 40 values in it.

My web app is just one page, but it is split up into several partial views (each with their own models and controllers). Each section needs to use some, but not all, of the values from the config file, though there is some overlap. E.g., ViewA needs `valueX`, and ViewB needs `valueX` and `valueY`.

My question is this - is it better to read the .xml file once in the main HomeController, and pass around the values to all of the other views/controllers? I'm not sure how I would do this. I can't really put these values into a model since each section has its own model, and I don't think I want to use ViewBag to store 40 values.

Or is it better to have each Controller read the xml file on its own and only get the data it needs? This would cause the same xml file to be read up to 5 times just to load one screen, and then every time a partial view is updated.

Will either or these options have an impact on performance or memory?