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.

Posted in Interwebs

9 comments so far

  1. Taruto said:
    On December 14, 2005 at 11:09 pm

    I had no idea there was any difference. :o

  2. Stephanie said:
    On December 15, 2005 at 2:42 am

    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. Elea said:
    On December 15, 2005 at 6:03 am

    Interesting. I learned something new today!

  4. Echo said:
    On December 15, 2005 at 7:14 am

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

  5. Jem said:
    On December 15, 2005 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. Vera said:
    On December 15, 2005 at 10:37 am

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

  7. Jem said:
    On December 15, 2005 at 10:39 am

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

  8. bliss said:
    On December 15, 2005 at 2:31 pm

    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. Ebony said:
    On December 15, 2005 at 4:41 pm

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