The MinifyResponse.HTML plug takes care of minifying the response body when the response content type is text/html.
Add minify_response to your list of dependencies in mix.exs:
def deps do
[{:minify_response, "~> 0.1.0"}]
end## Usage
plug MinifyResponse.HTML