This question came up during a presentation on ASP.NET v2.0, “Is the SqlDependency Attribute in OutputCache Directives Required Like VaryByParam Attribute?“
After doing some searching through the MSDN Library for Visual Studio 2005 (Beta 1), I discovered very little documentation about using the OutputCache directive. So, what is a boy to do? Go to code!
I added the <% OutputCache %>to a page and watched what happened when I tried to preview it in a browser. As expected, the parser stated that I had to have the Duration attribute.
So I then tried <% OutputCache Duration=”1” %>. Of course the parser had trouble with this as well-- Parser Error Message: The directive is missing a 'VaryByParam' attribute.
As we walk down the path <% OutputCache Duration=”1” VaryByParam=“None“ %>. The page made it pass the Parser and rendered.
Conclusion---SqlDependency is not a required attribute.