django_auxilium.middleware.html module

class django_auxilium.middleware.html.MinifyHTMLMiddleware(get_response=None)[source]

Bases: object

Middleware for minifying HTML.

Unlike some other minifyers, this minifyer is pretty simple and tried to do the bare minimum in an attempt of being super-lightweight.

This middleware only works when settings.DEBUG is disabled.

See also

django_auxilium.utils.html.simple_minify
What is used to actually minify HTML
process_response(request, response)[source]

Process the response by minifying HTML.

HTML is minified only when the response content type is HTML (e.g. contains 'text/html').