Asp.net master/content page caching problem
On my master page is repeater control, w开发者_开发百科hich basically puts together my site navigation. It is driven by an ObjectDataSource with caching enabled, it uses SqlCacheDependency to notify itself when a page is added or removed from the database.
Now, on my content page, i am using the following:
<%@ OutputCache Duration="999999" VaryByParam="slug" SqlDependency="SiteDataCaching:MenuHeaders" %>
And then access my dl to put together the pages title, content, metadescription etc etc.
The content page will refresh the cache no worries, but for some reason, if i am on page that has the OutputCache enabled, my menu on the masterpage won't update itself unless i forcefully hit ctrl+f5.
Anyone know why this is?
Thanks, Nick
I found this articles.. I hope they will help.
@ OutputCache
OutputCache - more examples
http://authors.aspalliance.com/aspxtreme/aspnet/syntax/outputcache.aspx
ASP.NET Page Output Cache
Hitting CTRL-F5 is a clientside action, so I would say that you've got the page you're looking at cached in your webbrowser. Try setting <%@ OutputCache Location="Server" ... %>
to deny clientside caching.
精彩评论