Laravel: Minify HTML

By | February 25, 2018

Assalamualiakum / Hi,

Just a quick blog post this time.

As part of optimisation, it’s important to minify your JavaScript & CSS – this can be done with Laravel Mix.

But how about HTML?

Seen this?

Ugly HTML Codes

So that’s how it’s look like our generated HTML codes.

And how we going to change into this?

Minified HTML Codes

A simple middleware will do to minify our HTML.

Then register the middleware and you are good to go!

Just grab this the Laravel Page Speed, then you’re done!

Thanks,
Nasrul

3 thoughts on “Laravel: Minify HTML

    1. nasrulhazim.m Post author

      Sama-sama pak Nafies.

      Ini salah satu cara untuk optimise HTML codes.

      Selalunya kita minify JavaScript dan CSS, tapi sebenarnya kita juga perlu minify HTML codes.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

five × four =