25 Aug

How to minify HTML files

To provide best website performance it makes sense to minify static HTML files. There several ways to do that. One of the most easiest is to use django-htmlmin. To install run:

python-pip install django-htmlmin

To minify run:

pyminify index.html > index_minified.html

It would make sense to tar/zip files before you minify them.

You can also use it as a library for Flask and, obviously, Django. Check the documentation to get the details.