4 ms·
I don't know about static sites. I would imagine to be very beneficial, in terms of bandwidth, to minify HTML. But I once worked on a Facebook-like SaaS, and m
by salehenrahman 14y ago
I don't know about static sites. I would imagine to be very beneficial, in terms of bandwidth, to minify HTML.
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.
- TazeTSchnitzel 14y agoCouldn'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?
- salehenrahman 14y agoNot 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.
- mistercow 14y agoYeah, it seems like the correct order of operations would be to minify the template itself (when compiling it), which would eliminate any overhead.
- krapp 14y agoTwig has the spaceless tag to remove whitespace from its templates, using that and its caching option might be basically what you're describing.