Home All Groups Group Topic Archive Search About
Author
5 Jan 2006 11:43 PM
Nalaka
Hi,
I have the following requirement for caching a asp.net 2.0 page.

Can some one please tell me if this is possible....
and a some direction would also be wonderful


I have a ASP.net 2.0 page with 1 user control.

1.1  I want the main page to be cached for a day.
1.2  I need the ability to cancel the cache (auto recreate) programatically.
       Basically undert certain situations, I should be able to get the page
regenerated during the day.
2.   I want the embeded usercontrol to be refreshed every minute.


Thanks in advance
Nalaka

Author
6 Jan 2006 9:16 AM
Teemu Keiski
Hi,

these should help you

Response.RemoveOutputCacheItem
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebHttpResponseClassRemoveOutputCacheItemTopic.asp

in the UC you can play with CachePolicy (also via OutputCache directive)
http://msdn2.microsoft.com/en-us/library/system.web.ui.usercontrol.cachepolicy.aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Show quoteHide quote
"Nalaka" <nalaka12@nospam.nospam> wrote in message
news:eINYIHlEGHA.648@TK2MSFTNGP14.phx.gbl...
> Hi,
> I have the following requirement for caching a asp.net 2.0 page.
>
> Can some one please tell me if this is possible....
> and a some direction would also be wonderful
>
>
> I have a ASP.net 2.0 page with 1 user control.
>
> 1.1  I want the main page to be cached for a day.
> 1.2  I need the ability to cancel the cache (auto recreate)
> programatically.
>       Basically undert certain situations, I should be able to get the
> page regenerated during the day.
> 2.   I want the embeded usercontrol to be refreshed every minute.
>
>
> Thanks in advance
> Nalaka
>
>
>
Are all your drivers up to date? click for free checkup

Author
6 Jan 2006 9:47 AM
Steven Cheng[MSFT]
Hi Nalaka,

Welcome.
For the page caching questions you mentioned, here are some of my
understanding and suggestion:

For ASP.NET page's output cache, it is caching the entire page output so we
can not cache page ,but make one of the contained usercontrol not cached...


And for programmatically invalid page's output cache, so far we I can get
is the following options:

1. Using custom cache vary to specify cache dependency

2. Use the HttpCachePolicy's AddCallback Handler  for page cache
valication....

Here are some related reference article mentioned these means:

#ASP.NET's Cache Bonus
http://www.softsteel.co.uk/tutorials/AspNetCaching/

#HttpCachePolicy.AddValidationCallback Method  
http://msdn2.microsoft.com/en-us/library/system.web.httpcachepolicy.addvalid
ationcallback.aspx

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


-------------------- 
| From: "Nalaka" <nalaka12@nospam.nospam>
| Subject: asp.net 2.0 caching
| Date: Thu, 5 Jan 2006 15:43:07 -0800
| Lines: 21
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <eINYIHlEGHA.***@TK2MSFTNGP14.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368927
Show quoteHide quote
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi,
| I have the following requirement for caching a asp.net 2.0 page.
|
| Can some one please tell me if this is possible....
| and a some direction would also be wonderful
|
|
| I have a ASP.net 2.0 page with 1 user control.
|
| 1.1  I want the main page to be cached for a day.
| 1.2  I need the ability to cancel the cache (auto recreate)
programatically.
|        Basically undert certain situations, I should be able to get the
page
| regenerated during the day.
| 2.   I want the embeded usercontrol to be refreshed every minute.
|
|
| Thanks in advance
| Nalaka
|
|
|
|

Bookmark and Share