Handling configuration settings in asp.net web application

后端 未结 4 507
生来不讨喜
生来不讨喜 2021-01-14 07:42

I have a web application with over 200 configuration settings. These control everything from UI to Business logic.

Should these be retrieved on application startup o

4条回答
  •  [愿得一人]
    2021-01-14 08:20

    We have a lot of configuration settings, too. We store them in a central database table. On first access, we load them all from the database and store them in Cache with an absolute expiration of 1 minute. This allows us to have an in-memory copy of our configuration settings, while also allowing us to push configuration updates that we know will be applied in, at most, 1 minute.

    So, it's kind of a hybrid. On the first request for a configuration setting, they are all loaded and stored in Cache. This operation is pretty light-weight, so having it happen every minute is not a big deal for us.

    Your mileage may vary.

提交回复
热议问题