I have a number of appSettings in web.config that are used frequently (i.e. on each post back). Does the ConfigurationManager hold these values in process or are there any performance gains to be had by copying these values into application state on ApplicationStart() and subsequently retrieving them from there?
+5
A:
AFAIK the configuration is read and parsed at startup and the data is held in memory thereafter. I don't believe any performance gains from caching the state in application variables will be significant - though you may get improved readability as you don't litter the code with ConfigurationManager.AppSettings[...]
.
Vinay Sajip
2009-08-20 09:03:06
Thanks for the info. I use my own common method for accessing state, so the "litter" would only be in one place anyway. :-)
Moose Factory
2009-08-20 09:14:40