472,371 Members | 1,605 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

Caching?

Could someone explain, Caching.

I understand Caching as simply saving a copy of something that is unlikely
to change and to which you frequently refer as opposed to retrieving a fresh
copy every time... like throwing something into Application["myValue"] in
ASP3. Now that Iam all "up to date" everyone wants to Cache everything
because its "good shit!".

How is Cached data any different than data you place in a globally accesible
variable?

p.s.: don't refer me to the BOL as I want an unbiased explanation from real
people who really use/don't use caching
Nov 17 '05 #1
6 1472
Ok, let me try, answer you question, you store in caching, the data that
maybe some time will change, but it's pretty static, and/or data that comes
from an external source that is very expensive to go each time and look for
the data.

--
Bela Istok
"kevin" wrote:
Could someone explain, Caching.

I understand Caching as simply saving a copy of something that is unlikely
to change and to which you frequently refer as opposed to retrieving a fresh
copy every time... like throwing something into Application["myValue"] in
ASP3. Now that Iam all "up to date" everyone wants to Cache everything
because its "good shit!".

How is Cached data any different than data you place in a globally accesible
variable?

p.s.: don't refer me to the BOL as I want an unbiased explanation from real
people who really use/don't use caching

Nov 17 '05 #2
Bela,
Thanks for the try, but...

I think I understand that. But how is this any different than putting
something in Application["myValue"] for a web app or into a member variable
of a class... as I asked originally?

"Bela Istok" wrote:
Ok, let me try, answer you question, you store in caching, the data that
maybe some time will change, but it's pretty static, and/or data that comes
from an external source that is very expensive to go each time and look for
the data.

--
Bela Istok
"kevin" wrote:
Could someone explain, Caching.

I understand Caching as simply saving a copy of something that is unlikely
to change and to which you frequently refer as opposed to retrieving a fresh
copy every time... like throwing something into Application["myValue"] in
ASP3. Now that Iam all "up to date" everyone wants to Cache everything
because its "good shit!".

How is Cached data any different than data you place in a globally accesible
variable?

p.s.: don't refer me to the BOL as I want an unbiased explanation from real
people who really use/don't use caching

Nov 17 '05 #3
The difference is the Cache has a Timeout and expires, and the Application
variable lives for all the application live. In the Application variable you
go for the value every time you want, the Cache objects notifies you when the
Cache expired, and you can go for the new data only in that moment.

--
Bela Istok
"kevin" wrote:
Bela,
Thanks for the try, but...

I think I understand that. But how is this any different than putting
something in Application["myValue"] for a web app or into a member variable
of a class... as I asked originally?

"Bela Istok" wrote:
Ok, let me try, answer you question, you store in caching, the data that
maybe some time will change, but it's pretty static, and/or data that comes
from an external source that is very expensive to go each time and look for
the data.

--
Bela Istok
"kevin" wrote:
Could someone explain, Caching.

I understand Caching as simply saving a copy of something that is unlikely
to change and to which you frequently refer as opposed to retrieving a fresh
copy every time... like throwing something into Application["myValue"] in
ASP3. Now that Iam all "up to date" everyone wants to Cache everything
because its "good shit!".

How is Cached data any different than data you place in a globally accesible
variable?

p.s.: don't refer me to the BOL as I want an unbiased explanation from real
people who really use/don't use caching

Nov 17 '05 #4
OK. But can't this Cache get expensive itself. How do you (I mean you
specificall) decide when to Cache as opposed to using variables. Also I am
assuming that in most instances we are talking about database lookups or
authentication information.

"Bela Istok" wrote:
The difference is the Cache has a Timeout and expires, and the Application
variable lives for all the application live. In the Application variable you
go for the value every time you want, the Cache objects notifies you when the
Cache expired, and you can go for the new data only in that moment.

--
Bela Istok
"kevin" wrote:
Bela,
Thanks for the try, but...

I think I understand that. But how is this any different than putting
something in Application["myValue"] for a web app or into a member variable
of a class... as I asked originally?

"Bela Istok" wrote:
Ok, let me try, answer you question, you store in caching, the data that
maybe some time will change, but it's pretty static, and/or data that comes
from an external source that is very expensive to go each time and look for
the data.

--
Bela Istok
"kevin" wrote:

> Could someone explain, Caching.
>
> I understand Caching as simply saving a copy of something that is unlikely
> to change and to which you frequently refer as opposed to retrieving a fresh
> copy every time... like throwing something into Application["myValue"] in
> ASP3. Now that Iam all "up to date" everyone wants to Cache everything
> because its "good shit!".
>
> How is Cached data any different than data you place in a globally accesible
> variable?
>
> p.s.: don't refer me to the BOL as I want an unbiased explanation from real
> people who really use/don't use caching

Nov 17 '05 #5
Kevin,

I use static classes for this, however AFAIK acts it the same in ASPNET.

Your globally placed variable will be set automatically to null (released)
when a page is sent.

Be aware that the cache and a static class in aspnet belongs to all active
clients (sessions) and will be removed if there are no sessions more active.

I use it is by instance to set ConnectionStrings, data that is not needed
for update.

To store data between sent you have 4 opportunities

viewstates, witch is sent and received every time to/from the client
sessions, which belongs to the client

static classes and caching, which belongs to the complete application and
therefore to all active sessions (without to separate them if you don't do
that).

I hope this was an answer on your question

Cor
Nov 17 '05 #6
You are right I use the Cache for Authentication and expensive DB lookups. In
the .NET framework 2.0 we will have an option to link the Cache to a DB
table, and the System will be the responsible to expire the Cache when the
table changes.
--
Bela Istok
"kevin" wrote:
OK. But can't this Cache get expensive itself. How do you (I mean you
specificall) decide when to Cache as opposed to using variables. Also I am
assuming that in most instances we are talking about database lookups or
authentication information.

"Bela Istok" wrote:
The difference is the Cache has a Timeout and expires, and the Application
variable lives for all the application live. In the Application variable you
go for the value every time you want, the Cache objects notifies you when the
Cache expired, and you can go for the new data only in that moment.

--
Bela Istok
"kevin" wrote:
Bela,
Thanks for the try, but...

I think I understand that. But how is this any different than putting
something in Application["myValue"] for a web app or into a member variable
of a class... as I asked originally?

"Bela Istok" wrote:

> Ok, let me try, answer you question, you store in caching, the data that
> maybe some time will change, but it's pretty static, and/or data that comes
> from an external source that is very expensive to go each time and look for
> the data.
>
> --
> Bela Istok
>
>
> "kevin" wrote:
>
> > Could someone explain, Caching.
> >
> > I understand Caching as simply saving a copy of something that is unlikely
> > to change and to which you frequently refer as opposed to retrieving a fresh
> > copy every time... like throwing something into Application["myValue"] in
> > ASP3. Now that Iam all "up to date" everyone wants to Cache everything
> > because its "good shit!".
> >
> > How is Cached data any different than data you place in a globally accesible
> > variable?
> >
> > p.s.: don't refer me to the BOL as I want an unbiased explanation from real
> > people who really use/don't use caching

Nov 17 '05 #7

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

Similar topics

15
by: olle | last post by:
Hi folks. I learning asp.net and compare it with traditional asp and Access-developing. The issue is this one: 1/I have this Ms Acceess adp-project application that works fine on my Ms Sql...
1
by: moko | last post by:
I want to know whether 'dataset caching' is at the client end , or the server ? Similarly is an aspx page caching at the server or client ? Are there any 'gotchas' with caching ?
0
by: Troy Simpson | last post by:
Hi, I have a website which is made up of dynamic pages. Each page that's loaded has some code which looks at which template to load amongst other things, which causes the page to take a little...
3
by: Janaka | last post by:
Hi All, I'm having a problem with Page Output caching on a page that contains a DataGrid. Basically the page pulls up some data for sales information from the DB. Some of this has to be...
1
by: Leo Muller | last post by:
I am impressed by the caching performance of .NET. However, there is one major obstacle that I haven't managed to solve yet. What I want to do is the following: I have a normal site, and a...
3
by: DC | last post by:
Hi, (ASP.Net 1.1) is it possible to (programmatically and globally) deactivate page fragment caching? We have only two scenarios, development stage where we want caching off and testing where we...
5
by: Raj | last post by:
What is the purpose of file system caching while creating a tablespace? Memory on the test server gets used up pretty quickly after a user executes a complex query(database is already activated),...
2
by: George1776 | last post by:
All, I've recently upgraded our production ASP.NET/C# application from framework 1.1 to 2.0. Since then I've been plagued by out-of-memory errors and problems with the cache object (which may...
0
by: jason | last post by:
hi experts, support.microsoft.com/kb/917072 and http://msdn.microsoft.com/msdnmag/issues/06/07/WebAppFollies/ As pointed out in these articles, users might get session variables belong to...
4
by: Hermann | last post by:
My site is a bit slow showing the main page so I thought caching query result in PHP will improve performace. Then I read MySQL documentation and saw that MySQL does have a caching feature. So......
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.