Its cached in memory, caching on disk doesn't make any sense, its already on disk.
First of all in ASP.NET you want to ensure you access configuration sections through the HttpContext object's GetSection
method (this uses the cached copies managed by ASP.NET).
Performance of accessing config values is a function of the internal implementation of the Section object (the object returned by GetSection). A ConfigurationSection
may simply act as wrapper for a DOM node which it may read on every request for a property. OTH it could internaly cache the value and watch for changes.
My advice would be keep your code simple and just access the values you need via GetSection
rather than attempt to hold copies of them elsewhere but by all means maintain a reference to the object returned by GetSection
for the duration of a request if you are going to fetch multiple values from it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…