improve: cache tool icons by setting max-age HTTP header and enable gzip compression SVG icons from backend (#2971)

This commit is contained in:
Bowen Liang
2024-03-26 10:11:43 +08:00
committed by GitHub
parent 58e4702b14
commit 1f98a4fff3
3 changed files with 12 additions and 3 deletions

View File

@@ -5,6 +5,12 @@ def init_app(app: Flask):
if app.config.get('API_COMPRESSION_ENABLED', False):
from flask_compress import Compress
app.config['COMPRESS_MIMETYPES'] = [
'application/json',
'image/svg+xml',
'text/html',
]
compress = Compress()
compress.init_app(app)