I just read this article from Google. I always thought that closing tags is important to keep html documents clean and make them machine-readable. But they recommend the opposite.
What do you think about this?
Google are in a somewhat unusual situation in that they serve so very many copies of their main search pages that any tiny saving in page size soon add up. This means for them it's economical to make their pages smaller by removing close tags and whitespace, at the cost of making them harder to maintain.
You aren't Google; it's unlikely to pay off for you. You'll notice the Google page you link to itself doesn't omit the tags it recommends, because it's not one of the critical pages that Google serves a lot of. Compare that to the extreme minification of www.google.com front page.
Use gzip/deflate compression and you'll already get mostly minimal transfer size; reducing markup further is a desperate measure which unless you're serving loads will be a premature optimisation.
It depends entirely on your doctype. If you use HTML 4 transitional, then yes, you're fine leaving off end tags. If you use XHTML or HTML 4 strict, then no, close your tags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With