diff --git a/app/views_task.py b/app/views_task.py index d632db0..99ecce2 100644 --- a/app/views_task.py +++ b/app/views_task.py @@ -233,7 +233,18 @@ def test_split_api(): @app.route('/api/do_distribute_cross', methods=['POST']) def do_distribute_cross(): - return distribute_cross(request.get_json()) + res = distribute_cross(request.get_json()) + # 手动gzip压缩 + compressed_data = gzip.compress(res.encode('utf-8'), compresslevel=6) + + return Response( + compressed_data, + headers={ + 'Content-Encoding': 'gzip', + 'Content-Type': 'application/json', + 'Content-Length': str(len(compressed_data)) + } + ) @app.route('/api/cross_monitor_record_info', methods=['GET'])