I have a page (called default.aspx) containing the following directive to ensure that caching is disabled:
Code:
<%@ OutputCache Duration="30" Location="None" VaryByParam="None" %>
This page contains a user control (called navigation.ascx) that does not contain an OutputCache directive at all. This user control contains dynamic data retrieved from an XML document.
If I load default.aspx then change the navigation xml source. Then reload the page the user control (navigation.ascx) is loaded from cache. I can tell this because I'm writing the current time out in the Page_Load function and the contents doesn't change. This user control should not be cached because it does not contain a OutputCache page directive.
Another strange fact is that if I load another page that was not previously loaded (called feedback.aspx) the user control displays a fresh version (updated with a new date and data). The fresh version shows only on feedback.aspx and the old version still shows on default.aspx. If I change the navigation xml source again I now have 3 versions of the navigation (default.aspx version, fresh.aspx version, and source version).
It seems that the user control itself is not being cached, but the page is caching it's parts. Is this possible, or is it something else? How do I disable this so that I always get a fresh navigation even when the same page is reloaded?