Search code examples
performancepage-load-time

Embedding code (css, js) into a document on high profile sites


Is there an advantage of some sort (speed or performance wise) to embed your CSS and JS into your web page, as opposed to keeping the code in sparate files? I was raised to believe that keeping code separate in separate files makes things easier to maintain. However, on high profile websites like amazon or google even facebook, I see a lot of embed code. Is there a performance reason they choose to do so or is it just an old/new way of doing things. I suppose my question is similar to this one: Should I inline CSS & JS in mobile sites to save bandwidth?

But I would like to hear form experts, most notably from people who worked on high profile web sties and have done so, if any.

P.S.

Bonus Question: Last html comment on amazon web pages is <!-- MEOW --> does it mean anything or is it just a funny prank?


Solution

  • Stoyan did an experiment that you might find interesting http://www.phpied.com/style-tag-to-inline-style-attrrib/