From d223bdeebca5bea8c928531b92d5b0e5ea70f105 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Tue, 3 Feb 2026 23:25:13 +1100 Subject: [PATCH] Add compression --- app.py | 3 +++ requirements.txt | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index e804368..f763d40 100644 --- a/app.py +++ b/app.py @@ -22,12 +22,15 @@ from flask_htmx import HTMX import minify_html import os from dotenv import load_dotenv +from flask_compress import Compress # Load environment variables from .env file in non-production environments if os.environ.get('FLASK_ENV') != 'production': load_dotenv() app = Flask(__name__) +app.config['COMPRESS_REGISTER'] = True +Compress(app) app.config.from_pyfile('config.py') app.secret_key = os.environ.get('SECRET_KEY', '2a661781919643cb8a5a8bc57642d99f') jinja_partials.register_extensions(app) diff --git a/requirements.txt b/requirements.txt index 22808c4..213e456 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,4 +17,5 @@ Flask-Bcrypt==1.0.1 email-validator==2.2.0 requests==2.26.0 polars>=0.20.0 -pyarrow>=14.0.0 \ No newline at end of file +pyarrow>=14.0.0 +Flask-Compress==1.13 \ No newline at end of file