Re:Ask HN: Why do we minify JavaScript, yet not HTML?
by TazeTSchnitzel on Sunday December 02, 2012 @04:18PM
(#4862546)
Couldn't whitespace-stripping be done as a function of the templating language? I suppose spitting it out verbatim is cheaper, though.
EDIT: Wait, isn't that something the template compiler could do?
Re:Ask HN: Why do we minify JavaScript, yet not HTML?
by salehenrahman on Sunday December 02, 2012 @04:21PM
(#4862563)
Not sure. We simply used a templating engine. Either a) we didn't take the time to read the documentation properly to find out if there is an efficient minifier, or b) there isn't an efficient templating engine that minifies.
I'm betting big on using preprocessor languages, such as HAML, or Jade.
But I once worked on a Facebook-like SaaS, and minifying HTML had huge performance hit on the back-end, since we used templates, not a proprocessor language such as Jade or HAML.