--- id: flask-minify version: "0.50" license: MIT license_treatment: permissive maintenance: active --- # Flask-Minify — Flask extension to minify html, css, js and less. License: permissive · Maintenance: active · Downloads: 88.8K/mo ## What it is and what it does Flask-Minify is a Flask extension that intercepts and minifies HTML, JavaScript, CSS, and Less content in your application's responses. It works by parsing outgoing response bodies and reducing their size through whitespace removal and syntax optimization, using pluggable parsers for each content type. By default it minifies all responses unless explicitly bypassed; you can also run it in passive mode to minify only specific decorated routes. The extension depends on six, flask, lesscpy, htmlminf, jsmin, xxhash, and rcssmin for its core minification logic. It supports caching of minified responses to avoid reprocessing identical content, configurable bypass rules using regex patterns, and optional use of a faster Go-based minifier on Linux systems if the tdewolff-minify package is installed. Use it for: - Reduce bandwidth and improve page load times in production Flask applications by automatically minifying all HTML, CSS, and JavaScript responses. - Selectively minify only specific routes using decorators when you need fine-grained control over which endpoints have minified output. - Bypass minification for certain endpoints (e.g., API responses or dynamically generated content) using regex patterns to exclude them from processing. - Cache minified response variations to avoid re-minifying identical content on repeated requests, with configurable limits on cached variations. - Customize minification behavior per content type by replacing default parsers or providing custom parser implementations for specific tags. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Flask extension that automatically minifies HTML, JavaScript, CSS, and Less output from your application to reduce response size. Yes. Flask-Minify is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem for Flask applications seeking to reduce response size. The MIT license is permissive. Install it if you want automatic minification of HTML, CSS, and JavaScript responses without manual configuration; the decorator and bypass options give you control when you need it. ## Install pip install flask-minify uv add flask-minify poetry add flask-minify ## Installing Flask-Minify Before you install: Low friction install with a pure-Python default setup. Active maintenance with recent releases; last commit 2026-04-13. Optional Go dependency available for Linux systems offers performance improvement but is not required. License in practice: MIT license permits commercial and private use with minimal restrictions; you must include the license notice in distributions. Quickstart: pip install Flask-Minify from flask import Flask from flask_minify import Minify app = Flask(__name__) Minify(app=app, html=True, js=True, cssless=True) Verify before relying: - Whether the optional Go dependency (tdewolff-minify) is actually available and maintained on PyPI - Performance impact of minification on typical Flask applications with various response sizes - Compatibility with Flask versions beyond those implied by the classifiers ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 88.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags flask minify html css js, flask response compression, flask asset minification, reduce flask response size, flask static file minifier, flask css js html minifier, flask output optimization, flask-extension, asset-optimization, response-compression [View on SkillFed](https://skillfed.io/packages/flask-minify) · [View on PyPI](https://pypi.org/project/flask-minify/)