HighTechTalks DotNet Forums  

Response.Cache.VaryByParams[] is being ignored?

ASP.net Caching microsoft.public.dotnet.framework.aspnet.caching


Discuss Response.Cache.VaryByParams[] is being ignored? in the ASP.net Caching forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
DC
 
Posts: n/a

Default Response.Cache.VaryByParams[] is being ignored? - 02-08-2007 , 10:21 AM






Hi,

in the codebehind of an .aspx, I am doing the following (in
Page_Load):

int cacheDuration = 10;
TimeSpan cacheSpan = new TimeSpan(0, 0, cacheDuration);
DateTime now = DateTime.Now;
Response.Cache.VaryByParams.IgnoreParams = false;
Response.Cache.VaryByParams["parm1;parm2"] = true;
Response.Cache.SetLastModified(now);
Response.Cache.SetExpires(now.Add(cacheSpan));
Response.Cache.SetMaxAge(cacheSpan);
Response.Cache.SetCacheability(HttpCacheability.Pu blic);
Response.Cache.SetValidUntilExpires(true);

Caching works, but if I add alternating values to URL parameters
(parm1 + parm2) the page will still be refreshed every 10 seconds,
regardless of what the parameters contain.

TIA for any hint on what could be the reason for this.

Regards
DC


Reply With Quote
  #2  
Old   
DC
 
Posts: n/a

Default Re: Response.Cache.VaryByParams[] is being ignored? - 02-08-2007 , 10:32 AM






I forgot to mention: I am still using Framework 1.1 - for just a
little more time

On Feb 8, 4:21 pm, "DC" <d... (AT) upsize (DOT) de> wrote:
Quote:
Hi,

in the codebehind of an .aspx, I am doing the following (in
Page_Load):

int cacheDuration = 10;
TimeSpan cacheSpan = new TimeSpan(0, 0, cacheDuration);
DateTime now = DateTime.Now;
Response.Cache.VaryByParams.IgnoreParams = false;
Response.Cache.VaryByParams["parm1;parm2"] = true;
Response.Cache.SetLastModified(now);
Response.Cache.SetExpires(now.Add(cacheSpan));
Response.Cache.SetMaxAge(cacheSpan);
Response.Cache.SetCacheability(HttpCacheability.Pu blic);
Response.Cache.SetValidUntilExpires(true);

Caching works, but if I add alternating values to URL parameters
(parm1 + parm2) the page will still be refreshed every 10 seconds,
regardless of what the parameters contain.

TIA for any hint on what could be the reason for this.

Regards
DC



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.