4 ms·
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 s
by TazeTSchnitzel 14y ago
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?
- 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.