Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 29th, 2003, 11:20 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default what is the diference between Cahe and the session

is there a difference if i use either cache or session to store values for current user.

Ahmed Ali
Software Developer
__________________
Ahmed Ali
Senior Software Developer
 
Old December 30th, 2003, 12:18 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Try using the cache and see what happens. I think you'll find that if you store x=1 in the cache for one user, any other user will also see x=1. The cache, to my knowledge, is not user (i.e. session) specific.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 31st, 2003, 02:38 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

do you mean on one machine,if user1 logout, and user2 log in on the same machine the data will remain, till now i do reset the cache after i finished using it.

finally is the cache like Application stored glopally???

Ahmed Ali
Software Developer
 
Old December 31st, 2003, 05:39 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

In some respects, the Cache is similar to Application state in that it stores information accessible for all users. Application state is not available for other servers in a Web farm scenario, and AFAIK, the same is true for Caching.

Caching allows you you to cache frequently used data, like the results of a complex query that takes a long time to run. Storing it in the cache allows you to easily reuse it without performing the same query again. The advantage of the cache is that it can clear itself automatically (i.e. when your server runs out of memory) or that you can bind dependencies to caching (i.e. remove from the cache in 20 minutes, or remove it when file X changes). This is not possible with the Application sate, so if you store too much info, your server will run out of resources.

But how about you do a little Google-ing for this? All the information you need is available on the Web.

http://www.google.com/search?hl=en&i...he+application

http://www.google.com/search?hl=en&l...=ASP.NET+Cache

http://msdn.microsoft.com/library/de...asp?frame=true

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconcacheapis.htm


It's all there. IMO, doing some investigation yourself is much more rewarding than posting a question here and waiting a day or so for an answer.....

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old December 31st, 2003, 09:32 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by alyeng2000
 ...till now i do reset the cache after i finished using it.
Then what's the point of using the cache??

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 31st, 2003, 03:59 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

ok thx all,
i got it,
i have got these line from MSDN,
The main difference between the Cache and Application objects is that the Cache object provides cache-specific features, such as dependencies and expiration policies.

ASP.NET introduces a new key/value pair object—the Cache object. The scope of the ASP.NET cache is the application domain; therefore, you cannot access it from other application domains or processes. The ASP.NET Cache object's life span is tied to the application, and the Cache object is re-created every time the application restarts, similar to the ASP Application object.

finally
i have understood that cache is used for heavily used data per domain for example a query result is cached for each request for all users access the same domain within a defined timeout determined by the first calling user for these query, but but but i am not clear about that and still ambiguous



Ahmed Ali
Software Developer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Diference between these two name spaces pradeepn XSLT 1 June 25th, 2007 02:31 AM
session and cookie problem (empty session file) msincan BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 February 27th, 2005 05:31 PM
session help -Dman100- Classic ASP Basics 1 November 29th, 2004 12:45 AM
what's the diference between readonly and const?? gbianchi VB.NET 2002/2003 Basics 2 November 11th, 2004 02:53 PM
session nav Beginning PHP 3 August 19th, 2004 02:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.