dify / api /extensions /ext_compress.py
kikuepi's picture
Upload 4913 files
4304c6d verified
raw
history blame contribute delete
374 Bytes
from flask import Flask
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)