You can’t have your cookie and cache it too
I recently discovered a poorly documented (in fact I couldn’t find any documentation about it) side effect of writing server-side cookies. They cause outputcaching not to work, and they do so in a nonobvious way. If your outputcache directive looks like this: <%@ OutputCache Duration= "100" VaryByParam= "none" location= "Any" %> But somewhere in your page you have code that looks like: Response.Cookies[ "user" ][ "value" ] = "something" ; The page will not be cached. Sure, it’ll have the public cache-control/expires headers, but the value will always be 100 (duration), and it won’t be cached by IIS. There won’t be any errors or warnings, it simply won’t cache properly. In our case it was even less obvious because the cookie writing code had been written a long time ago in a base page, and was only triggered on certain pages with certain querystring parameters. Even when I discovered pages that I had assumed to