Google homepage doesn't close html tags, on purpose
blog.bug.gd
blog.bug.gd
HTML is not XML.
It might be invalid, it is "monstrously invalid XHTML", but it is not "monstrously" invalid HTML.
I think I've spent so many years battling with anti-standards folks that I now take it personally when people advocate leaving out tags and not using a proper Doctypes and the countless other things Google does. In this case, I failed to do any research before making my argument, and have been deftly slain for it ;)
I'd like to see Google provide facts and figures. When Steve Souders worked at Yahoo! a large part of recommendations were backed up by experimental data collected by Tenni Theurer (my manager's wife, coincidentally).
I'd like to see Google provide the same kind of experimental data for their guidelines. If saving 14 bytes is a network saving, where are the page render tests in browsers, particularly "A-grade" browsers?
In light of the whipping their "facts" on PHP optimization recommendations have received here ( http://news.ycombinator.com/item?id=676856 ), it's best not to take pronouncements from a google post as coming from on high.
Well, the question I answered was whether it was valid. I'm not knowledgeable enough to answer the speed question.
Every browser that handles HTML 4 supports a kind of "tag soup". You must take explicit action to shift them into a strict mode; consequently, it does not take longer to "parse a broken schema" -- handling an HTML document without the final closing tags should be no slower than a complete document, because no validation is taking place.
pmjordan pointed out that my assertion that the per user loading/rendering time is completely independent of the scale is overstating the case, as he illustrated with a CDN and custom software. However, in my response to him, I think I made a good case that that argument doesn't hold for stripping closing tags?
A more accurate headline would have been "Google leaves out some optional tags, as understood by all browsers and permitted by every HTML specification since the beginning of time".
I'm surprised to see such a literal nitpick upvoted so much, but I can't disagree that you're correct technically. I'm just trying to share an odd/interesing position of Google's and not trying to write a deep analysis or anything.
Of course, the grandparent overstates his case and is unconstructive as a result. His fallacy is that he argues that someone must be an idiot, because they make a trivial error. Which overlooks the fact that trivial errors are made by experts all the time, exactly because it's a trivial point that doesn't have their attention. You wouldn't believe the silly errors PhD's fix in the papers of fellow PhD's.
Is this a nitpick? Perhaps if your subject had been something other than markup, or valid markup in particular, you'd be right. I think it's reasonable, though, when writing on a technical subject, to insist on correct usage of that subject's basic technical vocabulary.
From what I can see in their source, there is a lot more they could do to optimize their bandwidth and page load speeds than eating a couple of closing tags.
<html>
<head>
Here's our head
<body>
Here's our body <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Here's our title</title>
<link rel="stylesheet" href="stylesheet">
<p>Here's our body
And this is valid HTML 5: <!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Here's our title</title>
<link rel="stylesheet" href="stylesheet">
<p>Here's our body
(From http://meiert.com/en/blog/20080429/best-html-template/ )So the fact that these elements aren't closed probably improves (by a measurable percentage) user engagement/success on their site.
What is it? Are the books they read (instead of the actual specs) really that terrible?
http://msdn.microsoft.com/en-us/library/ms533020(VS.85).aspx...
In fact, leaving tags out consistently in certain tag-heavy auto-generated layouts, by reducing network IO and fitting more content into memory buffers at a time, could be faster.
Whereby "even faster" still means much slower than standards-adherent browsers. I can't imagine that closing the tags improves the speed enough for it to make any real difference. Better to optimize a javascript algorithm or compress an image to squeeze out another millisecond or two.
The attribute value may only contain letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45), periods (ASCII decimal 46), underscores (ASCII decimal 95), and colons (ASCII decimal 58). We recommend using quotation marks even when it is possible to eliminate them.
From HTML 5 (http://www.w3.org/TR/html5/syntax.html#attributes):
...the attribute value, which, in addition to the requirements given above for attribute values, must not contain any literal space characters, any U+0022 QUOTATION MARK (") characters, U+0027 APOSTROPHE (') characters, U+003D EQUALS SIGN (=) characters, or U+003E GREATER-THAN SIGN (>) characters, and must not be the empty string.
I bet inline styles and scripts are heavier in the long run than cached as external resources for millions of requests, specially multiple requests a day per user.
Now, I don't know how cache works, but if you have to make a resource request just to get a 'has not changed' response, then the problem is in the protocol.
How about sending all 'modified-since' tags in the header for every resource, so the client then requests a second bulk with all the resources required?
Somebody can explain how cache works in the browser?