问题
Is it executed / read-by-the-server every time a page on the site is loaded?
回答1:
The web.config is loaded into memory when the Application is created. This is typically the first request to a page/resource in the application. IIS (ASP.NET) monitors the web.config for changes and will restart your Application if a change is made.
If your question is actually "will web.config settings automatically update when the file is changed?" The answer is YES HOWEVER your Application will be restarted which can result in unexpected behavior including session and data loss.
Some of the above statements are not always true and I recommend reading this: http://msdn.microsoft.com/en-us/library/ms178685.aspx
来源:https://stackoverflow.com/questions/11233540/when-is-the-web-config-file-executed