.NETGURU
Caching User Specific Data In a Multi User App?
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcache' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Jason Squatrito
-- Moved from [aspngfreeforall] to [aspngcache] by Yannick Smits <Click here to reveal e-mail address> --

Hey Everyone -

I've got a page pulling back a result set that is user specific, and I
would like to be able to cache it as a data view since the page gives a
lot of options for sorting the data.

I would like to insert the data into Page.Cache, but that is not user
specific....My next thought was to add the data
with a unique key per user, something like "Data" & SessionID, but that
seems awkward.

Anyone have any thoughts?

Thanks!

Reply to this message...
 
    
Rob Howard (VIP)
Does the data change on each request?

You've got a couple of options:
1. Cache it using a user specific key, e.g. if authenticated:
string key =3D HttpContext.Current.User.Identity.Name + "-MyDataView";

2. If the data changes on each request, but you access it multiple times
in a request put it in the HttpContext.Items collections. It's a
dictionary that is available only for the life of the request.

Thanks
Rob

-----Original Message-----
From: Jason Squatrito [mailto:Click here to reveal e-mail address]=20
Sent: Monday, June 24, 2002 8:04 PM
To: aspngcache
Subject: [aspngcache] Caching User Specific Data In a Multi User App?

-- Moved from [aspngfreeforall] to [aspngcache] by Yannick Smits
<Click here to reveal e-mail address> --

Hey Everyone -=20

I've got a page pulling back a result set that is user specific, and I
would like to be able to cache it as a data view since the page gives a
lot of options for sorting the data.

I would like to insert the data into Page.Cache, but that is not user
specific....My next thought was to add the data
with a unique key per user, something like "Data" & SessionID, but that
seems awkward.

Anyone have any thoughts?

Thanks!

| [aspngcache] member Click here to reveal e-mail address =3D YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp =3D JOIN/QUIT

Reply to this message...
 
    
Michael
You can use the asp.net cache api to cache the data using Cache.Add...

I'd be careful though it sounds like your data might actually be
indeterminate in size.... which could mean trouble if ur system is going to
take heavy loads... I'd consider serializing it out to the hard disk.

My advice is do some time checks using the trace before you leap into
caching stuff...
You'd only want to be caching in circumstances where skipping recreation of
the data delays the response time by a substantial amount...

-----Original Message-----
From: Jason Squatrito [mailto:Click here to reveal e-mail address]
Sent: Tuesday, 25 June 2002 1:04 PM
To: aspngcache
Subject: [aspngcache] Caching User Specific Data In a Multi User App?

-- Moved from [aspngfreeforall] to [aspngcache] by Yannick Smits
<Click here to reveal e-mail address> --

Hey Everyone -

I've got a page pulling back a result set that is user specific, and I
would like to be able to cache it as a data view since the page gives a
lot of options for sorting the data.

I would like to insert the data into Page.Cache, but that is not user
specific....My next thought was to add the data
with a unique key per user, something like "Data" & SessionID, but that
seems awkward.

Anyone have any thoughts?

Thanks!

| [aspngcache] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp = JOIN/QUIT

Reply to this message...
 
 
System.Web.Caching.Cache
System.Web.HttpContext
System.Web.UI.Page




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification