From a800163aeae0998fa49f011664f32a6c348db886 Mon Sep 17 00:00:00 2001 From: mjfernez Date: Wed, 6 Oct 2021 21:47:10 -0400 Subject: Adds gzip support by default This commit adds Flask-Compress to the stack, an excellent module that makes the site load faster. This also adds and amends the default siteconfig --- server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server.py') diff --git a/server.py b/server.py index 1908ad3..8937d4b 100644 --- a/server.py +++ b/server.py @@ -1,8 +1,10 @@ import os from flask import Flask from siteconfig import siteconfig +from flask_compress import Compress app = Flask(__name__) +compress = Compress() from views import * @@ -30,9 +32,10 @@ def setup(): app.config.update({'DOMAIN': siteconfig.DOMAIN}) app.config.update({'HOME_TITLE': siteconfig.HOME_TITLE}) - + app.config.update({'COMPRESS_MIMETYPES': siteconfig.COMPRESS_MIMETYPES}) # Setup needs to come first to be compatible with wsgi setup() if __name__ == "__main__": + compress.init_app(app) app.run() -- cgit v1.2.3