"Attaching a CacheDependancy to a ASP.NET Page using Output Caching" or "I can't believe they didn't think of this...oh sweet, they did!"
ASP.NET caching This seems like an obvious thing to want to do, but I can't see how. I have a bunch of pages using OutputCaching, like <%@ OutputCache Duration="600" VaryByParam="none" %> but the pages use additional data points / files that I'd like to add as additional cache dependencies. I can create the extra CacheDependency objects, but can't see how to connect them up to the cache entry for the page. I can't beleive the ASP.NET guys didn't think of this.[Simon Fell]
Simon is looking to add a CacheDependancy to a ASP.NET Page using Output Caching, he'll need to use HttpResponse.AddCacheItemDependency and HttpResponse.AddCacheItemDependencies.
The most interesting thing about what Simon says is "I can't believe the ASP.NET guys didn't think of this." That's funny, because I know as well as anyone that the Microsoft guys aren't perfect, but when it comes to the .NET Framework, I'll tend to search just a little harder on the faith that what I need HAS to be there...because they must have thought about this. As you spend time with the .NET Framework you'll increasingly get that same attitude; they really did think this thing through.