5 ms·
Go view the source of Google.com No </body> or </html> tags for one.
by albertsun 16y ago
Go view the source of Google.com
No </body> or </html> tags for one.
- coderdude 16y agoWhich is funny, because there are so many better ways for them to reduce the data transfer. They have colors specified in hex that could be reduced to shorthand and save 3 characters. Example: <body bgcolor=#ffffff text=#000000 etc They are also wasteful in their embedded styles: Example: margin:3px 0 4px;margin-left:4px Heck, they could even change the path to the images they include on the site to "img" or "i" instead of "images" Or remove the "http:" from the urls they link to from the homepage. Though, I'm not sure if all UAs will handle this correctly. They should.
- rimantas 16y agoThey can drop <html> and <body> too. Also, instead of <meta http-equiv="content-type" content="text/html; charset=UTF-8"> they could have <meta charset=utf-8> People often tell that Google squeezed every byte out of their markup, but it is far from the truth.
- prodigal_erik 16y agoThose have been optional in every HTML DTD since 2.0 (the earliest I saw). It bugs me when everyone calls markup like this "invalid" when they actually mean it was browser authors who failed to follow the specs (in this case, SGML content model rules).
- jasonmoo 16y agoA friend of mine worked for Google when that was introduced and said it was purely a rendering speed optimization. Someone did some tests and found the page pops a little faster if you leave out those closing tags. I can't seem to find any articles on it but it seems more reasonable than trying to save a couple bytes, given the other markup that's been mentioned here.
- paulirish 16y agoFriend of mine did tests on this and found there is no significant performance difference in either direction. So dropping them is certainly worth it.