On Oct 14, 2005, at 7:45 AM, Christopher Brown wrote:
I'd like a second opinion on this -- the style sheet is 89KB. Is that
overly large? Is there a way to tell how long it takes to load?
Lots of ways to guess. And yes, it's quite large.
I believe I can break it into (more or less) 10KB chunks, with the
idea
that it's quicker to load three 10KB cascading sheets than one 89KB
sheet. Does that sound reasonable?
No. Every http request carries its own overhead. 1 30KB file will
probably beat both other options for speed. But on an intranet, the
spedd difference won't be noticeable, probably not a noticeable
difference between all three options. The tag soup in the pages will
probably eat more speed than the CSS download does. (How do I know
the pages are tag soup? I deduce that from the following remark.)
The developers tell me that the cache is purged with each page
load, so
I think it loads each time. The intranet I work on runs on IE6 only.
I don't see how the developers can know that, unless every browser i
the company is locked down tight, and even then I'm skeptical. I
suspect they're wrong.
How I'd deal with it:
Diagram the document structures found on the intranet (which tags are
found inside which other tags, what classes and ids are applied to
what tags, etc.) in a representative sampling of the pages.
Take that structure diagram to the CSS file, and start eliminating
duplication of styles. Begin by sorting the contents of the original
file. Into what order? Into *any* consistent order you can easily
comprehend. Then test it to make sure you haven't broken the
rendering by changing the order (remember the cascade). Then start to
remove duplicate entries, style rules that are unnecessary, etc.
Eliminate unnecessary ID's and classes, consolidate what you can.
The arrangement I like to use in the CSS file is "outside-in." If,
for example, I have three divs on the page: "header"," footer", and
"body," I'll choose one to begin with in the CSS, then the style
rules for the ids, classes, and tags for the descendants of it. If at
all possible, I keep the cascade working for me, making fewer style
rules necessary. Feel free to choose whatever CSS file arrangement
suits your hand, though. I make no claim that my way is the only way,
the most proper way, nor even the most efficient way. It is simply my
way.
Whatever you choose, it'd probably be helpful, if the file continues
to be so large, to build a diagram of the css as well. It should help
you in maintaining it later.
I'm having a really hard time figuring out just what could be in an
89K CSS file that isn't a lot of style duplication, or doesn't
reflect *really* bad use of CSS. I suppose it's possible, but I just
can't imagine it at the moment.
I'd also try and get access to the HTML generation, and start
seriously working on cleaning that up. 2-3 nested tables can slow
down your page rendering more than an 89K CSS file. I've found that
when dealing with direct networks, rendering the HTML generally is
the speed bottleneck, not downloading the bytes. Most direct network
connections support transfer rates far in excess of 100K/sec;
download time is the least of your speed problems.
Have Fun,
Arlen
------------------------------
In God we trust, all others must supply data
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/