Is AppSettings cached

T

Thomas

Hi,

Is AppSettings cached? And is the cache updated when web.config changes?

- Thomas
 
J

John Timney \(Microsoft MVP\)

If I remember correctly, appsettings is read each time you request it and it
aint cached - so you have to add it to the cache if you want to have it
cached.

As such it wont be updated when the config changes - but your application
will restart and flush the cache anyway. You will need to work out when to
readd it to the cache.

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
 
R

Rick Strahl [MVP]

AppSettings is always up to date - if web.config is changed the entire app
restarts...

I'm not sure if AppSettings is cached. I'd be surprised if it wasn't...

But, FWIW, it's a good idea to build a wrapper around AppSettings anyway for
a number of reasons. First to get a properly typed interface to your
configuration values and second to deal with generic error handling if the
value is not there...


+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/webblog/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top