Re: Fwd: Help with CSS?

by Andrew McFarland <aamcf(at)aamcf.co.uk>

 Date:  Sun, 26 May 2002 20:46:02 +0100
 To:  <hwg-techniques(at)hwg.org>
 References:  ntlworld email ais ais2 ais3 ntlworld2
  todo: View Thread, Original
At 15:05 26/05/02 -0400, Darrell King wrote:
>Sniffing does work.

Suppose I am behind cache X and I access http://www.example.com/page.html 
using browser foo. Example.com sends me a page for browser foo. So far 
everything is working.

2 minutes later, somebody else access http://www.example.com/page.html, 
also from behind cache X. The request never gets as far as Example.com. The 
cache just sends the cached version of the page which is aimed at browser 
foo, which may or may not be the correct version of the page.

_No_ server side solution can get round this for all caches, and a solution 
that circumvents the cache somehow is very antisocial. Caches are there for 
a reason. So are proxies.

>If there are cache or proxy issues, they will get the default page as
>intended by the site owner...presumably the simplest and oldest version, but
>even that is dependant upon the site's target audience.

No, they will get an unpredictable page depending on the behavior of the 
cache or proxy.

>No solution is 100%.  Not every client is going to want a simple, HTML 3.2
>cross-platform design.  If nothing else, it doesn't do much for cell
>phones...:). Even with the best of intention, no system will be foolproof.

The trick in an design for the web is to make it degrade gracefully. I have 
yet to encounter something that actually needs different pages sent to 
different browsers that doesn't have a more elegant solution. Even in the 
worst case scenarios - where you need horrible code forks in JavaScript for 
example - the underlying logic of the JavaScript sniffing is going to be 
the same as the underlying logic of the server side sniffing, but the 
JavaScript one will be cache and proxy friendly. (And you will be using 
object sniffing rather than browser sniffing if you do it client side.)

>Even so, I would hesitate to refer to a 99% effective solution such as
>platform sniffing as a system that "doesn't work."

Its high maintenance and it has unpredictable results. Sounds like 
something that doesn't work to me :-)

Using the @import trick to hide CSS from NS4 is the best thing to do. Cross 
platform, degrades gracefully, low maintenance, etc.

Andrew

--
http://aamcf.co.uk/

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA