Closed falquaddoomi closed 7 months ago
This seems to work, testing locally:
from flask import current_app as app
from flask_compress import Compress
Compress(app)
By default it seems to use Brotli, and testing our mock ml response on this site, Brotli compresses it the best. I'll throw it in my current PR.
https://github.com/GoogleCloudPlatform/functions-framework-python/issues/75
As best I can tell, Flask doesn't do any compression by default. The recommendation looks like
flask-compress
, but not sure if it will work with google'sfunctions_framework
flavor of flask. https://github.com/colour-science/flask-compressMight need to do it manually: https://stackoverflow.com/questions/30165475/how-to-compress-minimize-size-of-json-jsonify-with-flask-in-python