Forum Moderators: not2easy
why would they do that? what benefit do they get out of it? they obviously know what they're doing, so i'm curious as to what the thinking behind it is.
when you think how many hits they must get every day, they must be blowing a fortune on bandwidth. they could stick that entire 45KB in an external stylesheet and save themselves a fortune.
... and i haven't even mentioned the in-page javascript ...
What's still suprizing though, is that they include what I could only guess is the CSS for all their main types of pages. You'd think considering they're put in the header, that server side includes would only include the relevant stuff. I guess that's sorta the point you were bringing up, perhaps.
[edited by: Xapti at 4:28 am (utc) on Oct. 13, 2007]
Since browsers spend 80% of the time fetching external components including scripts, stylesheets and images, reducing the number of HTTP requests has the biggest impact on reducing response time.
See also: Yahoo Video "High Performance Web Sites: 14 Rules For Faster Page" [video.yahoo.com]
Google's homepage has 3 HTTP requests: the page, the logo and an undisplayed composite image - cached, ready to be used on the results pages.
Note these are not normal pages/sites, and their Performance Best Practices [developer.yahoo.com] recommends using external files for CSS and javascript for most pages:
The key factor, then, is the frequency with which external JavaScript and CSS components are cached relative to the number of HTML documents requested. [...]Home pages that have few (perhaps only one) page view per session may find that inlining JavaScript and CSS results in faster end-user response times.
Lots of useful information in those resources.