On 7/21/06, Alex Foley <[EMAIL PROTECTED]> wrote:
> Here's the question... I've got one static stylesheet that should be the
> same for every page of my site, but then I have specific stylesheets
> that only apply to specific sections or subsections.  My solution now is
> to have a single dynamic stylesheet that assembles these on the fly, but
> I think this means that the browsers have to download a new copy of the
> stylesheet for every page they visit, because I construct it like this:
>
> webcommon/styles/screen.css?tab=company&amp;subtab=about
>
> So here's my question.  Is it more valuable to have two HTTP requests,
> one for the static page, and a second for the dynamically generated
> CSS?  Or keep it as one request?  The combined file is always between
> 6-7 KB, and the master stylesheet is about 5.5KB.  Should I make two
> stylesheet calls on every page so that the browser caches the
> stylesheet, like this:
>
> webcommon/styles/screen.css
> webcommon/styles/dynamic.css?tab=company&amp;subtab=about
>
> or should I keep combining them?  Basically, the idea is to minimize
> HTTP requests, because there are many images, etc., on these pages.
> Caching styles may be a huge draw too.  Someone who knows more about
> this please let me know.
>
I would say that overall you would get best performance overall by
having a static primary css file and a series of small static files
called as needed. That way (if some of your subsections expand to
several pages) you get the advantage of caching for the small files as
well. And by the sound of it most of the extension files will be under
1.1KB and therefore fit in a single TCP packet. It should be easier to
maintain and easier to debug style problems, too.

-- 
Richard Grevers, New Plymouth, New Zealand
Hat 1: Development Engineer, Webfarm Ltd.
Hat 2: Dramatic Design www.dramatic.co.nz
______________________________________________________________________
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