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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response Caching

Status
Not open for further replies.

GIGN

Programmer
Oct 6, 2000
1,082
NZ
I need to be able to toggle Response Caching, so my admin users see their newly inserted content - but cannot get it to work programmatically - it works ok to clear , but not t set expiry etc:


Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetExpires(DateTime.Parse("6:00:00PM"))
Response.Cache.SetValidUntilExpires(true);


Why is it just not doing anything?

<bb/>
 
Turns out they are right when they say VaryByParam must be set - also need to do this when setting Caching programmatically:

...
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetExpires(System.DateTime.Now.AddSeconds(60)
Response.Cache.SetValidUntilExpires(true);
Response.Cache.VaryByParams(&quot;None&quot;) = true;
...



Makes life much easier...

<bb>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top