473,325 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Cache Questions

Hi,

I was playing with the cache class (caching data, not fragments or
pages). It seems to be a very usefull feature, but I didn't manage to
find an explanation on how it works behind the scene. Except being
plain curious about it, I have a few concrete reasons for wanting to
know that, like:

- Can I store instance of a class in the cache ? If I can, what will
happen if one session pulls that object out of the cache and calls
it's method which changes content of the object ? Will the change be
visible globally ? I suppose yes ?
- Does that class need to be marked Serializable ? I noticed that if
you want to store object in the StateBag, that object must be marked
Serializable. Does something similar apply to Cache ? I tried that on
my machine and had no problems, but haven't tried it yet on the web
server - need to verify that other users see changes made to the
cached class...

Zeljko
Nov 18 '05 #1
4 1360
Hi,

The cache is eventually hash table in the application session domain
holding pairs of keys and objects. The different between cache and
application state is that cache comes with mechanism of dependency that
let you set relationship between cache expiration by setting
dependencies. (basically Cache class call CacheInternal that use
CacheEntry which implement hash table). All this story was just to show
you that cache is eventually hashtable so every change that you made
will be visible globally. You can conclude from this implementation that
cache doesn’t required serialization. Unlike statebag or session that
requires serialization if the object is going to be preserve on another
application domain, process or machine cache is always maintains in
application app domain thus doesn’t required serialization.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
Thanks for the info - you helped me a lot. However - I do have one
more question - what is application domain in the context of ASP .NET
? Application object ? IIS ? Is there any relation between IIS
application protection settings and scope of application domain ?

E.g. if application protection is set to Low (IIS process) - does that
mean that all applications are running in the same domain and cache
will be shared by all applications on the server ?

Thanks,

Zeljko

On Mon, 24 Nov 2003 23:52:31 -0800, Natty Gur <na***@dao2com.com>
wrote:
Hi,

The cache is eventually hash table in the application session domain
holding pairs of keys and objects. The different between cache and
application state is that cache comes with mechanism of dependency that
let you set relationship between cache expiration by setting
dependencies. (basically Cache class call CacheInternal that use
CacheEntry which implement hash table). All this story was just to show
you that cache is eventually hashtable so every change that you made
will be visible globally. You can conclude from this implementation that
cache doesn’t required serialization. Unlike statebag or session that
requires serialization if the object is going to be preserve on another
application domain, process or machine cache is always maintains in
application app domain thus doesn’t required serialization.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 18 '05 #3
Hi,

Every web application that you set via IIS is application domain in the
aspet_wp / w3wp process. asp.net can recycle one of the applications by
restarting application domain ( If you wonder, you can't).

IIS 5 and IIS 6 have different relationship with asp.net process. IIS 5
get requests and use pipes to transfer request to aspnet_wp process
while in windows 2003 w3wp has its own http.sys and receive its request
directly. So while IIS 5.0 isolation can impact IIS part of handling the
request, IIS 6.0 doesn’t have any impact at all. Anyway isolation level
in aspnet_wp based on application domain. IIS 6.0 introduce application
pools that let you isolate application on process base.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4
Thanks again,

Zeljko

On Tue, 25 Nov 2003 03:51:13 -0800, Natty Gur <na***@dao2com.com>
wrote:
Hi,

Every web application that you set via IIS is application domain in the
aspet_wp / w3wp process. asp.net can recycle one of the applications by
restarting application domain ( If you wonder, you can't).

IIS 5 and IIS 6 have different relationship with asp.net process. IIS 5
get requests and use pipes to transfer request to aspnet_wp process
while in windows 2003 w3wp has its own http.sys and receive its request
directly. So while IIS 5.0 isolation can impact IIS part of handling the
request, IIS 6.0 doesn’t have any impact at all. Anyway isolation level
in aspnet_wp based on application domain. IIS 6.0 introduce application
pools that let you isolate application on process base.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 18 '05 #5

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

Similar topics

5
by: Alex | last post by:
Hi all, We're looking at a vendor who uses the InterSystems Cache Database Platform, but our IT department has zero experience with this system. This software package will have a pivotal and...
1
by: Jim | last post by:
Hi, I have a few questions regarding the cache object: Does the cache object exist through postbacks? The cache object only exists for the current request, right? Is there a way to cache...
4
by: Jim Owen | last post by:
I am storing all my application data in the application cache. Anytime I have a method as part of an asp.net form, I need to access the objects in the cache. The only way I can think of to do this...
2
by: Harry Simpson | last post by:
If anyone can chime in on these questions, I'd sure appreciate it. 1. How does the cache block fit in with the UIP Block - Is the "state" managed there handled any differently with the CAB...
4
by: Guadala Harry | last post by:
I want to create a STATIC method that removes all items from the Cache. Questions: 1. Is a safe thing to do (any threading issues?) 2. Is the following code a good way to get the job done -...
3
by: Jon | last post by:
I have a couple of tables I want to load into a dataset and keep around pretty much forever, although they will need to be refreshed every so often. I can either put the dataset into an...
14
by: Tom.PesterDELETETHISSS | last post by:
Hi, I think this question requires an in depth understanding of how a browser cache works. I hope I can reach an expert here. I may have found a quirk in the asp.net documentation or I don't...
11
by: Steve Franks | last post by:
I see several reference to using the ASP.NET 2.0 Cache object in C# where the documentation just shows snippets like this: if (Cache == null) ... do something However when I use this code in a...
2
by: =?Utf-8?B?Y2F0?= | last post by:
We recently moved an older ASP.NET 1.1 code base on to ASP.NET 2.0, .NET 3.0 and Windows 2003 Server SP2. We started experiencing the following issue with the web cache (the code is straightforward...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.