Anonymous-Access Site with Output Cache and Custom Web Part

My site has Anonymous Access enabled and Output Cache enabled. The AnonymousCache Profile is Intranet (Collaboration Site). I have a custom web part on themaster page that reads the User-Agent from http header and writes a link to theappropriate css file, depending on the client's browser.

When someone accesses the site anonymously (which is most of the time), theoutput of the custom web part is cached from previous users, and the wrong cssfile is written.

I would like to continue output caching on everything except the output of thecustom web part. I have tried:1. writing a querystring with a guid at the end of the stylesheet that changeseach time the webpart is executed<link href="/mystylesheet.css?rev=543a2c131d313b13e21f0" />2. Set property CacheBehavior="0" in the webpart tag on the masterpage

Neither worked. Any ideas on what I can do? All help is appreciated.

Disabling output caching is not an optionUsing a single css file for all browsers is not an optionSelecting the css file in client-side javascript is not desired

Go4Sharepoint, is a Microsoft Featured Community.
Microsoft, Windows, Sharepoint, Sharepoint logo, Windows logo, etc are trademarks of the Microsoft Corporation.
All product names, logos, copyrights, and trademarks mentioned are acknowledged as the registered intellectual property of their respective owners. This site is not in any way affiliated with, nor has it been authorized, sponsored, or otherwise approved by, Microsoft Corporation.