I have a simple bit of PHP code in the head section of my pages to load an Internet Explorer-specific stylesheet if necessary:
<?php
$useragent = $_SERVER['HTTP_USER_AGENT'];
if (stristr ($useragent, 'MSIE')) {
echo ('<link rel=stylesheet href="http://www.domain.org/nwwstyleIE.css" type="text/css">'); } ?>
Since most readers use MSIE, pages tend to be wp-cached <i>with</i> the MSIE stylesheet. (Ignoring for now the super-cached pages for logged-in users, most of whom use Firefox thus creating the opposite issue.)
The result is that non-MSIE readers get a messed-up layout. Or MSIE readers get a messed-up layout if the page was first viewed by a Firefox or Safari user.
How can I still dynamically supply the MSIE stylesheet in the cached file as needed? Javascript (which I unfortunately don't know at all well)?