473,651 Members | 2,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1555
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 ConnectionStrin gs, 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
3410
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 server database. In my main form I have an Access-combobox with Customer-names from my customer table. In this combo-box are about 2000 records.
1
1601
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
1733
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 while to be processed. At the moment I have programmatic page caching in the "loader" using paramater caching to send a cached version of every requested page back to the user. How can I get particular elements inside each page to cache without...
3
1631
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 calculated on the fly when the request is made, and so I thought it would be ideal to cache the page for a set amount of time. I've placed the following at the top of my page: <%@ OutputCache Duration="160" VaryByParam="None" %> Now the problem is...
1
1569
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 preview site. The normal site should have maximum performance, thus uses caching. The preview site is for internal use only, and should not use caching, since our content managers will want to see the updates directly. The only difference between the...
3
2479
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 want caching on. Is this doable? I think there is a config switch in 2.0, anything in 1.1? TIA for any hint,
5
7846
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), after some investgation i found out that most of it being consumed by filesystem caching... thanks to Liam and Phil Sherman for their valuable suggestions. Is it safe to turn off filesystem caching on every tablespaceon the server(i.e. DIO) ??...
2
6097
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 simply be a result of being out of memory.) We're running on IIS 5.1 on a single Windows 2000 server. We have a separate database server - SQL Server 2000 64 bit. Session state is stored on the database.
0
2171
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 other user ? So ....Session state and kernel-mode output caching don't mix. Has this bug been fixed?
4
2977
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... now I dont know if doing the PHP caching is worth the pain. Would there be any noticed performace improvement if I cache query results in PHP, considering that MySQL is already caching the queries? Thanks
0
8278
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
8701
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
8466
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
7299
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...
0
5615
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();...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4290
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1588
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.