File size: 377 Bytes
a8b3f00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from flask import Flask

from configs import dify_config


def init_app(app: Flask):
    if dify_config.API_COMPRESSION_ENABLED:
        from flask_compress import Compress

        app.config["COMPRESS_MIMETYPES"] = [
            "application/json",
            "image/svg+xml",
            "text/html",
        ]

        compress = Compress()
        compress.init_app(app)