Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

page output cache with "VaryByParm" & "VaryByCustom"

Status
Not open for further replies.

smallpotato

IS-IT--Management
Jun 6, 2002
14
0
0
HK
Hi, I have some qns about page cache with "VaryByParm" & "VaryByCustom".

At first, I use the page directive to set the output cache with "VaryByParm" on all query variables. The pages work fine.

Then, I changed it to set them at code behind. Since the page cache need to be depend on some session var, I'm trying to make use the "VaryByCustom" but the session info can't be obtained at the global.asax.

Any ideas on how to make this?
Thx in advance.
 
but the session info can't be obtained at the global.asax
Try using the httpContext.Current object


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
thanks ca8msm's suggestion but the session obj still can't be referenced with httpContext.Current object.
 
Yes it can


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
The httpContext.Current.Session is nothing when access it is referenced at the

public override string GetVaryByCustomString(HttpContext context, string arg){
return httpContext.Current.Session("xxxx")
}


under the global.asax

I'm using asp.net 1.1 and not sure whether the session would be access at the "GetVaryByCustomString" method. But I really need to have page cache based on the session variables. Any ideas on this issue?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top