[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.caching

Interesting OutputCache expiration problem

Yash Ganthe

10/6/2007 4:59:00 PM

Hi,

I have a user control MyControl.ascx which appears on various pages in
my ASP .NET 2.0 application. I have setup partial-page caching using
OutputCache directive so that this control gets cached on each page.
However, there is one page Update.aspx which contains the control and
has features that update the DB entries that determine the output of
the control.

I have set SqlDependency so that the control's cache is expired when
the table is updated. But on this page, if I update the DB, the cache
does not expire immediately, and hence when the page is returned back
to the user the control still shows the older values. The cache is not
expired immediately because the SqlDependency is only periodically
refreshed to check if there is a change. Since the DB is updated on
postback in an event handler, the postbacked page is returned with the
older cached control.

Is there a way to expire the control's cache immediately so that the
control on this page renders with the updated values?

Thanks,
Yash