Caching Confusion

OK, so I was getting this funky error on www.interscapeusa.com, and it kinda pissed me off. I couldn't track down why the site would randomly insert JavaScript into my web pages, throwing a really odd error in IE. Well, it turns out that Paul added a really nifty feature to XHEO|WebSkin that fixes the Framework 1.1 PostBack issue (you know, the one Microsoft still won't release a public fix for). Well, I was caching my pages without varying the parameter, and so at one point, a Netscape browser requested the page, and that output was cached. So when IE browsers hit it, it gives you the JavaScript bird and throws an error.

So basically, when implementing caching, you shoudl probably always use this syntax:

<%@ OutputCache Duration="600" VaryByParam="Browser"%>

That way, if the Framework renders something differently on a per-browser basis, you won't mess it up for some users. Like I did.

No Comments