I have a nodejs site built using express which we are trying to optimise. We have a layout.html file with a {{{body}}} token and several other html files which are merged into layout.html at runtime by the express rendering engine.
We would like to minify the html files as a post-build operation but it is failing because we have invalid markup in layout.html (the markup is valid after {{{body}}} has been replaced).
Developer A: Would like to fix the markup so we can minify post-build, partly because it makes working with the layout file easier in future, and partly because they believe we will get more of a performance benefit if we avoid the penalty of the web server CPU doing the minification at runtime.
Developer B: Says we should minify at runtime rather than fix the markup, and that we won't incur a penalty for doing so. They also believe minifying post-build will cause problems with express' rendering engine at runtime.
I don't know the tech well enough to know who is right and would welcome answers from experts in the field.