473,669 Members | 2,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using the Cache object vs. letting .net or IIS handle it

I had a conversation with a friend today.

I'm working on a project where I have an XML file that stores the site
structure and some page-centric variables. I have a handful of controls that
will be reading from this XML file.

My initial reaction was to load the XML file once, and then set it to a
cache object, so that it's cached and only updated if the file is updated on
the server.

He said that was unecessary, as IIS/.net will cache frequently accessed
files automatically for you.

Any thoughts on that?

-Darrel
Nov 19 '05 #1
13 1407
You had the right idea in the first place. Your friend is mixing up caching
with caching. ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"darrel" <no*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
I had a conversation with a friend today.

I'm working on a project where I have an XML file that stores the site
structure and some page-centric variables. I have a handful of controls
that
will be reading from this XML file.

My initial reaction was to load the XML file once, and then set it to a
cache object, so that it's cached and only updated if the file is updated
on
the server.

He said that was unecessary, as IIS/.net will cache frequently accessed
files automatically for you.

Any thoughts on that?

-Darrel

Nov 19 '05 #2
> You had the right idea in the first place. Your friend is mixing up
caching
with caching. ;-)


Hmm...;o)

So, what, exactly, does IIS/.net cache by default vs. what should I
explicitly cache?

-Darrel
Nov 19 '05 #3
Aye...you are right..

The O/S will likely "cahce" files that are being frequently access to savel
save the disk I/O work...but this is really different than the type of
caching we are talking about (I'm not aware of .Net doing any automatic
caching btw). putting it int he Cache object specifically puts in in the
asp.net worker processes memory space...Besides , the O/S definion of what's
"frequent" could be like hundres of times per
second....where as ours could be like a couple times....what good are
friends for when you got newsgroups??

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:uY******** *****@TK2MSFTNG P15.phx.gbl...
You had the right idea in the first place. Your friend is mixing up caching with caching. ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"darrel" <no*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
I had a conversation with a friend today.

I'm working on a project where I have an XML file that stores the site
structure and some page-centric variables. I have a handful of controls
that
will be reading from this XML file.

My initial reaction was to load the XML file once, and then set it to a
cache object, so that it's cached and only updated if the file is updated on
the server.

He said that was unecessary, as IIS/.net will cache frequently accessed
files automatically for you.

Any thoughts on that?

-Darrel


Nov 19 '05 #4
nothing.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"darrel" <no*****@hotmai l.com> wrote in message
news:ul******** ******@TK2MSFTN GP09.phx.gbl...
You had the right idea in the first place. Your friend is mixing up

caching
with caching. ;-)


Hmm...;o)

So, what, exactly, does IIS/.net cache by default vs. what should I
explicitly cache?

-Darrel

Nov 19 '05 #5
Hi, Darrel.

It might benefit you to read
backgrounders on caching.

See :
http://msdn.microsoft.com/library/de...sbestpract.asp

http://msdn.microsoft.com/library/de...sp04262001.asp

http://msdn.microsoft.com/library/de...sp03282002.asp

http://msdn.microsoft.com/msdnmag/is...ETPerformance/

http://msdn.microsoft.com/library/de...ey_caching.asp

http://msdn.microsoft.com/library/de...ce04172002.asp

http://msdn.microsoft.com/msdnmag/is...e/default.aspx


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"darrel" <no*****@hotmai l.com> wrote in message
news:ul******** ******@TK2MSFTN GP09.phx.gbl...
You had the right idea in the first place. Your friend is mixing up

caching
with caching. ;-)


Hmm...;o)

So, what, exactly, does IIS/.net cache by default vs. what should I
explicitly cache?

-Darrel

Nov 19 '05 #6
Well, you *could* argue that the compiled pages are "cached"
server-side, since no recompilation is needed to serve them,
but the primary benefit of caching is the substitution of database
retrievals, contents of XML-based data, etc.

Being able to load frequently-used data from memory,
instead of making data calls is the main benefit.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:OU******** *****@TK2MSFTNG P15.phx.gbl...
nothing.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"darrel" <no*****@hotmai l.com> wrote in message
news:ul******** ******@TK2MSFTN GP09.phx.gbl...
> You had the right idea in the first place. Your friend is mixing up

caching
> with caching. ;-)


Hmm...;o)

So, what, exactly, does IIS/.net cache by default vs. what should I
explicitly cache?

-Darrel


Nov 19 '05 #7
> second....where as ours could be like a couple times....what good are
friends for when you got newsgroups??


;o)

I see...the main benefit is that I'm at the mercy of IIS or the OS itself
deciding what to cache vs. me being able to tell .net explicitely what to
cache.

Thanks!

-Darrel
Nov 19 '05 #8

TO expand upon the question...is there an upper limit of files I shouldn't
cache myself?

For instance, this site will have about 10 XML files and 3 or so XSLT files.
Is there any reason NOT to go ahead and set all of them to cache objects,
since they'll rarely change on the server (maybe once a week or so at most)?

-Darrel
Nov 19 '05 #9
I thought the web.config file was automatically cached so it was only read
once and there was no perofrmance hit when reading one of the values.
--
Joe Fallon

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:OU******** *****@TK2MSFTNG P15.phx.gbl...
nothing.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"darrel" <no*****@hotmai l.com> wrote in message
news:ul******** ******@TK2MSFTN GP09.phx.gbl...
> You had the right idea in the first place. Your friend is mixing up

caching
> with caching. ;-)


Hmm...;o)

So, what, exactly, does IIS/.net cache by default vs. what should I
explicitly cache?

-Darrel


Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1963
by: David | last post by:
Please help. I am able to display a folder structure and files but I can't figure out how to add subfolders and maintain the same look. I am a little embarrased but I thought someone out there could help me out with this one. Please email me at dkoopman@statestreet.com if you have a solution for me. Thank you in advance, Dave <%@ Language=VBScript %>
9
3958
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it will not set the value of the control and will leave the checked status of the checkbox to false when a user selects a new date. this works fine when using the control on a win2k machine but if we use it on a win XP box and call
4
1661
by: NWx | last post by:
Hi, I' trying to implement a callback method when a cache object expires I want to do this to automatically logout user after a timeout (for demo purposes) My thought is, when user logon, create a cache object which expires after, let's say, 15 minutes, and in that moment, to direct user to a page telling the time to run demo app was expired.
12
3811
by: John M | last post by:
Hello, On Microsoft Visual Studio .NET 2003, I want to use some global elements, that can be used in each one of my pages. i.e I put a oleDBConnection on global.asax.vb How can I use it (the oleDBConnection on global.asa.vb) at the other aspx pages ?
1
2711
by: William Sullivan | last post by:
I'm trying to nail down some issues with the cache in my application. Currently, I have an object that stands between my business logic and database logic called CacheLogic (cute, no?). Global.asax.cs creates it in Application_Start, initializes it and places it in the cache. During initialization, CacheLogic retrieves data from the DB logic layer and caches it with removal callbacks set. Whenever an object in the business logic layer...
15
2411
by: Joe Fallon | last post by:
I would like to know how you can figure out how much memory a given instance of a class is using. For example, if I load a collection class with 10 items it might use 1KB, and if I load it with 1000 items it might use 100KB. How do I measure the amount of memory used once the class is loaded? Thanks! -- Joe Fallon
26
6242
by: Ed L. | last post by:
Here's some of my current notions on pgsql performance tuning strictly as it relates to pgsql tuning parameters in the context of a dedicated linux or hpux server. I'm particularly focusing on the shared_buffers setting. I invite any corrective or confirming feedback. I realize there are many other hugely important performance factors outside this scope. One key aspect of pgsql performance tuning is to adjust the memory ...
1
4967
by: Bill Faulk | last post by:
I want to avoid letting users use the back button on forms with multiple postbacks so I use Response.Cache.SetNoStore() for these pages. This works fine for IE7 and Firefox by showing the desired "this page is expired" message for those browsers. IE6 just shows a "the page cannot be displayed" error. Is there any way to avoid the error for IE6 and just show the page as expired when the user presses the back button? If there's any...
2
2202
by: Martin Eckart | last post by:
Hi guys, I have a class which contains ~ 200 properties. Out of those 200 properties I need to access 10 (which I know beforehand already) via reflection in another class. Currently I am doing the following with my context object which represents the class containing the 200 properties: Type t = context.GetType(); foreach (PropertyInfo prop in t.GetProperties()
0
8383
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8894
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8803
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8587
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6210
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2029
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.