Hi folks!
New to Laravel here, so please be kind.,
I was wondering what is the recommended way to minify HTML output on the fly. I found two projects on Github, but wasn't sure which one to go with?
Please help out.
7 messages · Page 1 of 1 (latest)
Hi folks!
New to Laravel here, so please be kind.,
I was wondering what is the recommended way to minify HTML output on the fly. I found two projects on Github, but wasn't sure which one to go with?
Please help out.
@nocturne tree Hi.
If you primarily need to minify HTML and prefer a simple, well-supported solution, use HTMLMin/Laravel-HTMLMin.
If you need to minify not only HTML but also inline CSS and JavaScript and want more control over the minification process, choose fahlisaputra/laravel-minify.
I wish you success in your business.
May I ask why you want to minify HTML? It's not very minifyable in the same way as JS is, and it already compresses really well.
@ruby nebula
HTML minification provides file size reduction, faster loading speed and performance for your project.
This is a benefit that is still provided even though it cannot be minified in the same way as JS.
Why not let this be taken care off by your webserver, like nginx? As Martin says, there's not a whole lot that can be minified, apart from stripping out newlines and spaces. So something like gzip would achieve pretty much the same or even better results
I don't think it does improve performance. I think compression already does that. How much can you really minify HTML, other than remove whitespace?
HTML responses are also often dynamic, which means you have to minify for each-request, much more expensive than minification at build-time as for JS