Re: Web.Config AppSettings & Caching
- From: "Terry Burns" <me@xxxxxxxx>
- Date: Mon, 6 Mar 2006 20:04:57 -0000
OK version 2.0 was not specified. So my questions are for 2.0
1.) Can all users settings be changed without the app restarting ?
2.) If 1) is yes, does this update the cached information when the changes
are made to the web.config ?
For version 1.x, my argument stands.
--
Terry Burns
http://TrainingOn.net
"Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uYUDjeRQGHA.4688@xxxxxxxxxxxxxxxxxxxxxxx
I>I fail to see a cogent argument Kevin, where is it ?
It isn't Terry.
In fact, Microsoft *has* modified the configuration model between versions
1.1 and 2.0 of the Framework. Some settings can be saved to a
configuration file without restarting the application, including some
custom configuration settings.
--
Kevin Spencer
Microsoft MVP
.Net Developer
Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
"Terry Burns" <me@xxxxxxxx> wrote in message
news:OGQe7gKQGHA.4956@xxxxxxxxxxxxxxxxxxxxxxx
I fail to see a cogent argument Kevin, where is it ?
--
Terry Burns
http://TrainingOn.net
"Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uApGETKQGHA.224@xxxxxxxxxxxxxxxxxxxxxxx
Now lets see
your argument aginst this ?
I give up, Terry. You're right, and all of the architects at Microsoft
are wrong.
--
;-),
Kevin Spencer
Microsoft MVP
.Net Developer
Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
"Terry Burns" <me@xxxxxxxx> wrote in message
news:uxuwieHQGHA.2124@xxxxxxxxxxxxxxxxxxxxxxx
I think you have the wrong end of the Stick Kevin.!
It can be deserialized and cached in memory when the application
starts (just like the web.config file). So far, we've done nothingYes we have, we can alter the XML file without restarting the
different from using a web.config file.
Application
If you are in a situation where you want to know if the Application
values have changed you can keep two sets of values and have your
code check for those changes and act appopriately.
So, what is this "situation where you want to know if the Application
values have changed?" That would be any time they are accessed. So,
how often does the application have to check the "DataSet
configuration file?" Every time one of those values is needed. So, how
often does file IO have to be employed to read and deserialize the
"DataSet configuration file?" Every time one of those values is
needed.
Hypothetically, there could be situatuion where the application needs
to know
a value has changed rather than simply using the value. As I state
later on in my
reply, the application only needs to read the XML file once at startup
unless
the value changes, wherein the form used to make the changes updates
the Application("myVariableName(s)").
The only difference here between your database solution and your
"DataSet configuration file" solution is that you've gone from a
full-blown relation database server to a file-based database. The
database (file) still needs to be opened with every read of a
configuration value. And, as I mentioned in my most recent reply, this
is simply not scalable.
No, you have misread me. The Application Start reads the XML file and
stores them in Application("myVariablesName(s)"). These can then be
read
by the application as it runs.
I have been known to be wrong from time to time. And I freely admit
when I am. That is how I keep my reputation for being a reliable
source of information. This issue is a tar baby, Terry. The more you
whack at it, the stucker you will get. Might be a good time to back
away from it.
I dont need to back away from something I see very clearly as being
valid. My solution
allows the same functionality as the web.config with one simple
difference, and that
is the user base need not be interupted when a value needs to changed.
Now lets see
your argument aginst this ?
--
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
"Terry Burns" <me@xxxxxxxx> wrote in message
news:%23kb7b5CQGHA.516@xxxxxxxxxxxxxxxxxxxxxxx
Actually it was Kevin, not Karl who said this.
Aside from who actually said it, using caching is not neccesary. On
application start the values can be read into Application keys and
read from there throughout the program. If you want to change this,
you can write an admin utility which changes the Application version
of the values when the SQL data changes. Actually, you dont even need
an SQL server, you can use a DataSet and write/read the values from
there, but do it through a maintenance form which updates the
application values. If you are in a situation where you want to know
if the Application values have changed you can keep two sets of
values and have your code check for those changes and act
appopriately.
This way you get the best of both worlds.
--
Terry Burns
http://TrainingOn.net
"Peter Bromberg [C# MVP]" <pbromberg@xxxxxxxxxxxxxxxxxxx> wrote in
message news:3AF94235-43AE-49D3-BE55-E61DABF9CDD9@xxxxxxxxxxxxxxxx
Fred,
As Karl indicated, the config file is processed once when the
application
starts, and even that is lightning fast. Further references to
config data
come from memory. And I agree that using a database to store
configuration
data that doesn't change often is an unneccessary overhead and adds
complexity, unless its an app that already uses a database. In
addition, if
the database is where the change of any config data occurs, one
would
additionally have to implement SqlCache callbacks so that the app
can get the
changed data in a timely manner.
Your focus on a high volume app needs to be more in the area of page
rendering, using caching intelligently and things like excessive use
of
Session and ViewState.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Fred Nelson" wrote:
Hi:
I have written several web applications that obtain their
connection
strings from the web.config file. This is very easy to use and it
makes
it easy to move an app from development into production.
I'm in the process of writing a site that will have lots of traffic
so
I'm trying to save resources everyplace that I can.
My question is - do the web.config app settings get loaded once
when the
application starts - or does the application read the entire XML
web.config file everytime that I request the connection string.
If the web.config is read each time then I will create a simple
class
library to return the string.
Thanks for your help!
Fred
.
- Follow-Ups:
- Re: Web.Config AppSettings & Caching
- From: Kevin Spencer
- Re: Web.Config AppSettings & Caching
- References:
- Web.Config AppSettings & Caching
- From: Fred Nelson
- Re: Web.Config AppSettings & Caching
- From: Terry Burns
- Re: Web.Config AppSettings & Caching
- From: Kevin Spencer
- Re: Web.Config AppSettings & Caching
- From: Terry Burns
- Re: Web.Config AppSettings & Caching
- From: Kevin Spencer
- Re: Web.Config AppSettings & Caching
- From: Terry Burns
- Re: Web.Config AppSettings & Caching
- From: Kevin Spencer
- Web.Config AppSettings & Caching
- Prev by Date: Deploying and inheritance
- Next by Date: Re: Link to another url
- Previous by thread: Re: Web.Config AppSettings & Caching
- Next by thread: Re: Web.Config AppSettings & Caching
- Index(es):
Relevant Pages
|