I'm completing a feature that was started by a previous developer. I notice that he's loading settings from the db in the Global.asax Application_Start method and puts the settings into HttpContext.Current.Application["SettingName"].
In development this works fine on my machine. If I'm not mistaken though this looks like in production it's going to load the data once when the application starts for the first user but settings will not be available to the application for any subsequent user.
Can someone please confirm or deny my suspicions?
The
HttpContext.Current.Application["SettingName"]
is a static property. It will be available to the next subsequent users as well. But you can not change it that easy, especial if you use web garden.You can read more details here: Using static variables instead of Application state in ASP.NET
I do not know how the design is, but you can use a simple static dictionary for the same... of direct read from the database your parameters, or from web.config.