On 7/20/06, Alex Foley <[EMAIL PROTECTED]> wrote:
> The problem is my main page is the heaviest of the pages...it carries a
> large Flash graphic (although that would soon go away...).  One thing
> I've decided on is that the user downloading a separate stylesheet for
> each page is no good... I have always maintained individual CSS files to
> avoid the one large file...possibly assembling this dynamically at the
> start would solve this problem.  Are there any negatives to a client
> downloading a 10-12K stylesheet right away?  Perhaps the answer is to
> give them the minimum on the main page, but on any other page serve them
> the full CSS...

Hi, Alex,

We ran into this same question when we redesigned our site. We split
up our stylesheets into three basic sheets -- 1 that provided the
basic layout, 1 that provided the standard content ornamentation (for
data tables and such) and 1 for small, page-specific elements (like an
ornament for a specific article). We also had specialized sheets for
sections of the site, like the account area, that shared a lot of
common styles not used elsewhere, and other sheets to support less
CSS-complete browsers (IE 6, IE 5, IE Mac, etc).

We found that multiple files wasn't that big a deal (multiple meaning
4 or 5, not dozens), because current browsers and servers support HTTP
pipelining, which lets the site send multiple files in one connection.
(IE 5+ mac and pc, Safari, Firefox, NS 7+ all support pipelining. I
assume Opera 7+ does also.)

When we did our speed tests, however, our basic style sheet load ended
up being about 25K, and IE 6 had to download close to 37K. This
included a home page-specific sheet named home.css, that was an
additional 5K.

The business managers felt that this would be too great an up-front
hit for folks on IE on dial-up. (We get around 2,000,000 visits per
month, so we can't ignore the 30% remaining on dial-up.) To resolve
this, we removed the main stylesheet, the content ornamentation
stylesheet, and the IE-fix stylesheets from the home page, and
increased the size of home.css to included the bare minimum of
main.css, content.css and filtered rules from the IE-fix stylesheets
to get the home page to work. This let us get down to about 20K,
total, for the home page.

By keeping layout.css in the mix, it let us start the caching process
for most browsers, so that 10K was being cached in the first hit,
reducing the second hit when the rest of the CSS got loaded.

It also helped that we could set our servers to GZIP our CSS files, so
that the load became that much smaller.

Long story short, the majority of your browser population will support
HTTP pipelining, so the number of files is less important than the
size of the files. Finding ways to spread your big files across
multiple pages can help also.

Also consider that if you have a script tag in your head tag, the
content of your site won't begin to appear until the stylesheet loads.
So on that first hit, you can assume that the 10-12K download will be
hidden in the time the user is waiting for the browser to contact the
site. 10K on a 56kbps modem is about 2 seconds.

If you are downloading, say, 30 or 50K of stuff in the head tag, then
it's time to start worrying. 10K shouldn't be too bad.

HTH,

Michael
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to