private static void LoadConfigSettings() { lock (s_BypassCacheBinding) { if (s_CacheConfigSettings == null) { RequestCachingSectionInternal section = RequestCachingSectionInternal.GetSection(); s_DefaultGlobalBinding = new RequestCacheBinding(section.DefaultCache, section.DefaultHttpValidator, section.DefaultCachePolicy); s_DefaultHttpBinding = new RequestCacheBinding(section.DefaultCache, section.DefaultHttpValidator, section.DefaultHttpCachePolicy); s_DefaultFtpBinding = new RequestCacheBinding(section.DefaultCache, section.DefaultFtpValidator, section.DefaultFtpCachePolicy); s_CacheConfigSettings = section; } } }
// private static void LoadConfigSettings() { // Any concurent access shall go here and block until we've grabbed the config settings lock (s_BypassCacheBinding) { if (s_CacheConfigSettings == null) { RequestCachingSectionInternal settings = RequestCachingSectionInternal.GetSection(); s_DefaultGlobalBinding = new RequestCacheBinding(settings.DefaultCache, settings.DefaultHttpValidator, settings.DefaultCachePolicy); s_DefaultHttpBinding = new RequestCacheBinding(settings.DefaultCache, settings.DefaultHttpValidator, settings.DefaultHttpCachePolicy); s_DefaultFtpBinding = new RequestCacheBinding(settings.DefaultCache, settings.DefaultFtpValidator, settings.DefaultFtpCachePolicy); s_CacheConfigSettings = settings; } } }