Following Google's pagespeed advice I would like the minify the HTML responses of my Spring application. I don't mean GZip, I mean removing comments and whitespace from HTML before it is sent down the wire.
I would like to do this dynamically and not in my templates. My templates contain many comments that are useful but should not be part of the response.
Following is my controller;
@Controller
public class IndexController {
@GetMapping("/")
public ModelAndView index() {
Data data = ....
return new ModelAndView("index", data);
}
}