Does the CloudConfigurationManager GetSetting method cache?

后端 未结 3 2062
太阳男子
太阳男子 2021-01-04 09:05

Does anyone know if you take a performance hit calling CloudConfigurationManager GetSetting method? Does it reparse the azure file for example or is it cached? Not sure if

3条回答
  •  生来不讨喜
    2021-01-04 09:36

    The source is available on github.

    If you take a look at the source you can see that it isn't doing any caching, so if you are seeing performance issues you may want to implement your own caching.

    The body of GetSetting shows a simple return:

    value = GetValue("ServiceRuntime", name, GetServiceRuntimeSetting);
    
    if (value == null)
    {
        value = GetValue("ConfigurationManager", name, n => ConfigurationManager.AppSettings[n]);
    }
    
    return value;
    

提交回复
热议问题