本文介绍了WebConfigurationManager.AppSettings的缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多,上面写着我的Web配置文件的请求

I have a lot of requests that read my Web Config file

variable = WebConfigurationManager.AppSettings["BLAH"]

不要 WebConfigurationManager.AppSettings 从磁盘每次读取,抑或是在内存中缓存?

Do WebConfigurationManager.AppSettings read from disk each time, or is it cached in memory?

如果它是从磁盘每次读取那么我想我需要将变量移动到一个静态变量,以提高我的应用程序的性能。

If it's read from disk each time then I guess I will need to move the variable to a static variable so as to improve my app performance.

推荐答案

配置设置缓存在内存和web.config中每次调用该函数时不会被解析。

Configuration settings are cached in memory and web.config is not parsed every time you call this function.

这篇关于WebConfigurationManager.AppSettings的缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 23:56