Change minify lib to minify_html (apparently faster)

This commit is contained in:
Peter Stockings
2022-12-05 22:39:48 +11:00
parent d780938d3b
commit 14ecae99e4
2 changed files with 4 additions and 3 deletions

5
app.py
View File

@@ -7,7 +7,7 @@ from decorators import validate_person, validate_topset, validate_workout
from db import DataBase
from utils import get_people_and_exercise_rep_maxes, convert_str_to_date, get_earliest_and_latest_workout_date, filter_workout_topsets, get_exercise_ids_from_workouts, first_and_last_visible_days_in_month
from flask_htmx import HTMX
from htmlmin.main import minify
import minify_html
app = Flask(__name__)
app.config.from_pyfile('config.py')
@@ -23,7 +23,8 @@ def response_minify(response):
"""
if response.content_type == u'text/html; charset=utf-8':
response.set_data(
minify(response.get_data(as_text=True))
minify_html.minify(response.get_data(
as_text=True), minify_js=True, remove_processing_instructions=True)
)
return response

View File

@@ -5,4 +5,4 @@ jinja-partials==0.1.1
psycopg2-binary==2.9.3
flask-htmx==0.2.0
python-dateutil==2.8.2
htmlmin==0.1.12
minify-html==0.10.3