Sorry i meant "could I", not "i could"! I've figured it out now anyway. Here's how if anyone wants to know.
Put this code in the code-behind for the page you want to cache:
int duration = Convert.ToInt32(System.Configuration.Configuration Settings.AppSettings["CacheDuration"];);
Response.Cache.SetExpires(DateTime.Now.AddSeconds( duration ));
Response.Cache.SetCacheability(HttpCacheability.Pu blic);
and in the Web.Config put this tag in the AppSettings section:
<add key="CacheDuration" value="60" />
where value is the time in seconds you want the pages to be cached for.
|