views:

72

answers:

1

Here is 3 css file (one is only for IE)

<link rel="stylesheet" href="css/blueprint/screen.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="css/blueprint/print.css" type="text/css" media="print">    
<!--[if lt IE 8]><link rel="stylesheet" href="css/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->

If i keep divide scree.css into these css in my website

Now it will be 6 css ( one is only for IE)

<link rel="stylesheet" href="css/blueprint/reset.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="css/blueprint/grid.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="css/blueprint/typography.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="css/blueprint/forms.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="css/blueprint/print.css" type="text/css" media="print">    
<!--[if lt IE 8]><link rel="stylesheet" href="css/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->

If i go for method two for a website even after production . Does it really slowdown the website page loading speed? if yes then how much? How much these 3 extra style sheet will affect site performance?

+5  A: 

Combining them into a single stylesheet reduces the number of HTTP requests a browser needs to make to load a page. However, after the first time a stylesheet is requested, assuming you've configured your cache directives correctly, the browser should have it cached and thus subsequent page loads won't see much of a difference.

Use a tool like Google's PageSpeed plugin or Yahoo's YSlow to figure out what's actually causing performance issues once you have most of the site in place, and optimize the things that matter. Don't worry about it before then.

Amber
This answer is spot-on, but I would like to wave the Firebug flag on this one. Using Firebug's Net tab, you get a tremendously useful break-down of every single resource, including an indication of the overhead of an additional DNS lookup. Get it here: https://addons.mozilla.org/en-US/firefox/addon/1843
David Foster
Yep. Don't start trying to fix performance problems before you know what the major contributing factors are. This particular difference is fairly minimal, but it will add up over hundreds of pages.
Paul McMillan
@David Foster: Google PageSpeed and Yahoo YSlow are actually *plugins for FireBug*, so I figured that I wouldn't explicitly mention FireBug itself, since the ones I mentioned cover that and add even more analysis of load time issues.
Amber
so it's only a matter of reducing http request, bandwidth use will be the same and it will only affect to home page of the site.
metal-gear-solid
and what would be ur answer if i ask same question for javascript? other than to put javascript at bottom.
metal-gear-solid
and it is mentioned "Reducing the number of HTTP requests in your page is the place to start. This is the most important guideline for improving performance for first time visitors. As described in Tenni Theurer's blog post Browser Cache Usage - Exposed!, 40-60% of daily visitors to your site come in with an empty cache. Making your page fast for these first time visitors is key to a better user experience." at http://developer.yahoo.com/performance/rules.html
metal-gear-solid
In general, bandwidth usage will be approximately the same, yes - the bandwidth overhead per HTTP request isn't that high relative to the content generally being served. Yes, the same answer applies to Javascript, it's simply another textual resource being transferred over HTTP. In regards to the blog post, there is no single "catch all" place to start for improving performance on every site; you really need to look at the profiler results for *your* site and figure out what that particular situation needs addressed.
Amber
but here is mentioned for javascript "Note that while JavaScript files are not reliably cached by browsers, CSS files are." http://www.websiteoptimization.com/speed/tweak/http/
metal-gear-solid
The technique described there is generally overkill.
Amber
@Dav: Of course, silly me. Though, last time I used Google PageSpeed I did so separately of Firebug. Nonetheless, there's still something to be said for Firebug's default functionality, specifically the Net tab. If all you're looking for is an indication of how much an additional DNS lookup will delay your page load time, then it's really all you need.
David Foster
If the question is just about multiple files being served from the same domain, though, there isn't any additional DNS lookup occurring - only another HTTP request.
Amber