Change minify lib to minify_html (apparently faster)
This commit is contained in:
5
app.py
5
app.py
@@ -7,7 +7,7 @@ from decorators import validate_person, validate_topset, validate_workout
|
|||||||
from db import DataBase
|
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 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 flask_htmx import HTMX
|
||||||
from htmlmin.main import minify
|
import minify_html
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config.from_pyfile('config.py')
|
app.config.from_pyfile('config.py')
|
||||||
@@ -23,7 +23,8 @@ def response_minify(response):
|
|||||||
"""
|
"""
|
||||||
if response.content_type == u'text/html; charset=utf-8':
|
if response.content_type == u'text/html; charset=utf-8':
|
||||||
response.set_data(
|
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
|
return response
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ jinja-partials==0.1.1
|
|||||||
psycopg2-binary==2.9.3
|
psycopg2-binary==2.9.3
|
||||||
flask-htmx==0.2.0
|
flask-htmx==0.2.0
|
||||||
python-dateutil==2.8.2
|
python-dateutil==2.8.2
|
||||||
htmlmin==0.1.12
|
minify-html==0.10.3
|
||||||
Reference in New Issue
Block a user