It is not an issue. There is built in logic that tosses old data to
make room for new data. Old data in this case meaning data that hasn't
been accessed for the longest time period.

To prevent data that is seldom accessed but expensive to acquire from
being tossed you can set a higher priority level when you add it to
the cache. Check out the docs on the Cache.Add(...) method overloads.

Keep Smilin'
Ed Stegman

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] Behalf Of Ryan Parlee
Sent: Monday, October 13, 2003 9:29 PM
To: [EMAIL PROTECTED]
Subject: ASP.NET Caching Issue


When I programmatically set the HttpCachePolicy, ASP.NET also appears
to
OutputCache the page.  However, I can't find a way to set different
aging
parameters for the server and client caches.  What I need is to be
able to
tell browsers to cache the response for 30 days, but have ASP.NET only
cache
the response for 2 days.  How can this be done?

Here's how I am currently caching:

  TimeSpan tsMaxAge = new TimeSpan(0, 0, 2592000);

Response.Cache.SetExpires(DateTime.Now.AddSeconds(tsMaxAge.Seconds));
  Response.Cache.SetCacheability(System.Web.HttpCacheability.Public);
  Response.Cache.SetMaxAge(tsMaxAge);
  Response.Cache.SetValidUntilExpires(false);
  Response.Cache.VaryByParams["id"] = true;


My response takes a relatively long time to generate and is quite
large.
The response will actually never change, so I should probably be
setting a 2
year timeout (or whatever is the maximum), but only for the browser.
I
can't have ASP.NET keep things around that long because it would
quickly
overwhelm my server. Is there a way to do this?  Or is it even an
issue?
Perhaps ASP.NET has built-in logic to handle this type of thing.

Thanks, Ryan

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to