Forum Moderators: not2easy

Message Too Old, No Replies

Time to load page

size of CSS

         

malcolmcroucher

9:22 am on Nov 9, 2007 (gmt 0)

10+ Year Member



would the size of your css file stall or make the loading of your html page slower

Marcia

9:45 am on Nov 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's counted in the total page size tally, you can check using the FireFox web developer tools.

And while this (very good) subject is brought up, what are acceptable size ranges for linked stylesheets?

penders

10:20 am on Nov 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It's counted in the total page size tally...

It's also an additional http request.

Bear in mind also that an external stylesheet should cache nicely, so the 'hit' is only felt by the very first page. Also if you are using compression...

HarryM

12:49 pm on Nov 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As penders said, the 'hit' is only felt by the very first page. But that makes the size very important.

The first page load includes the time for DNS lookup, http requests and downloads of favicons, javascript files, layout images, the CSS file(s), etc. Anything that slows down this process increases the risk that the user will perceive the site as being slow to load, and may deter them from clicking on another page. (Although due to caching the second page will load faster.)

vincevincevince

12:54 pm on Nov 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is always best to have your images on another subdomain to your page and your CSS because the browser limits the number of simultaneous connections it makes to one domain (or subdomain). I favour having javascript, css and the html from the main domain and images elsewhere. Even just the difference between www. and non-www will achieve this.

Marcia

3:02 pm on Nov 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Super tip vvv, thank you!

penders

9:37 pm on Nov 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...browser limits the number of simultaneous connections it makes to one domain...

Yeah thanks vvv - interesting! Snag is I rarely use absolute paths, for the sake of portability. A quick Google on the above finds...

The HTTP standard (to which all browsers are supposed to adhere) recommends that a browser should not attempt to open more than two simultaneous connections to the same site. That's not always enough, and the major browsers seem to be settling on 8 as the best value in practice. Any fewer than that and certain types of pages (e.g. those with AJAX content or lots of small images) might slow down. Any more, and a single browser can start tying up an unfair share of resources on the web server it's talking to.

HarryM

10:49 am on Nov 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One point I discovered the hard way is that any image referenced in the CSS file is automatically loaded even if the image is not used on the page itself. A large background image which might only be used on the index page can therefore slow the load of the landing page.