Questions about the HttpContext cache object.

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

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 objects across multiple requests/sessions?
Say, I have two users requesting the same page, can they share cached
objects?

Is there a way to measure the amount of resources used by the cache
objects per application/virtual dir, etc? (Win2k Server - if
specifically needed)


Thanks for any help

Jim
 
Jim,

See inline:

Jim said:
Hi,

I have a few questions regarding the cache object:

Does the cache object exist through postbacks?

Yes, it does.
The cache object only exists for the current request, right?

No, the affinity of the cache is the app-domain that it is running in.
So, all sessions have access to the cache.
Is there a way to cache objects across multiple requests/sessions?
Say, I have two users requesting the same page, can they share cached
objects?

The Cache object now does this.
Is there a way to measure the amount of resources used by the cache
objects per application/virtual dir, etc? (Win2k Server - if
specifically needed)

There are a few performance counters available for the cache. They are:

Cache Total Entries
Cache Total Hits
Cache Total Misses
Cache Total Hit RatioCache Total Turnover RateCache API Entries
Cache API HitsCache API MissesCache API Hit Ratio
Cache API Turnover Rate

You can find this list and the definitions of the counters in the .NET
framework documentation under "Performance Counters for ASP.NET", located at
(watch for line wrap):

http://msdn.microsoft.com/library/d...de/html/cpconperformancecountersforaspnet.asp

Hope this helps.
 
Back
Top