mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:39:25 +08:00
支持br和zstd
This commit is contained in:
@@ -46,3 +46,6 @@ pyyaml
|
||||
croniter
|
||||
bcrypt
|
||||
packaging
|
||||
Flask-Compress
|
||||
brotli
|
||||
zstd
|
||||
|
||||
@@ -24,6 +24,7 @@ from flask import Response
|
||||
from flask import Flask, abort, current_app, session, url_for
|
||||
from flask import Blueprint, render_template
|
||||
from flask import render_template_string
|
||||
from flask_compress import Compress
|
||||
|
||||
from flask_socketio import SocketIO, emit, send
|
||||
|
||||
@@ -44,6 +45,9 @@ setup.init()
|
||||
|
||||
app = Flask(__name__, template_folder='templates/default')
|
||||
|
||||
app.config["COMPRESS_ALGORITHM"] = ["zstd", "br", "gzip"]
|
||||
Compress(app)
|
||||
|
||||
# 缓存配置
|
||||
cache = Cache(config={'CACHE_TYPE': 'simple'})
|
||||
cache.init_app(app, config={'CACHE_TYPE': 'simple'})
|
||||
|
||||
Reference in New Issue
Block a user