Style Loading Time

I have known for a long time that there is a difference between the load time of a site using inline styles and a site using a stylesheet: I didn’t realise how much difference!

I uploaded my own without finishing things off, really — I’d forgotten to move my style to a stylesheet and hadn’t noticed this at all but HAD noticed a massive pause before my layout loaded. I thought maybe I’d forgotten to optimise the photo, but no.. all fine and dandy there. Tiny pages, tiny page structure, relatively tiny top image and still a huge delay in loading. I was checking my source just for errors and such and noticed the style in the of the document. Fixed it up, re-uploaded and.. wow. Instant load.

/random insight.

9 Comments

  1. I had no idea there was any difference. :o

  2. That seems weird. Shouldn’t it load faster with the style in the section, because it doesn’t have to load an extra file…? Still, nice to know it works the other way. ^^

  3. Interesting. I learned something new today!

  4. ~holding back the profanity What is an inline style? Gosh, Jem… speak ENGLISH!

  5. Jem

    15 Dec at 8:33 am

    Stephanie: well, no.. the thought is that when a browser loads a page with an external stylesheet, it caches the stylesheet and doesn’t have to re-load the same style with each page. It makes sense really, I just didn’t realise how big a difference there was, particularly with such a small page! Echo: inline style = css in the html document between style /style tags and the like :)

  6. wow… *stores knowledge for later use* So, did you implement your own style switching script then?

  7. Jem

    15 Dec at 10:39 am

    Not yet, I’ve not had chance. Been too.. lazy :p

  8. Actually, I was thinking the same thing Steph was -’cause initially, you’d think that the styles would load at just about the same time, and later the caching would mean that you wouldn’t have to load all the extra crap and whatnot. So it makes sense in the long run; just not in the beginning.

  9. Hmm, I didn’t know it was that much of a difference. See ya learn something new very day, lol!