Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Feature Request] Option to compress request payload in a callback

Đang mở
#3,924 1 bình luận 4 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Trước tiên, hãy đọc phần xử lý yêu cầu callback và PR #3925 được tham chiếu để hiểu cách tiếp cận được đề xuất. Công việc được xem là hoàn tất khi các callback có thể chọn nén gzip, áp dụng ngưỡng kích thước payload đã nêu và duy trì hành vi mặc định không nén.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement P3 size: 3

Problem
While the payload of the HTTP response bodies can be compressed in case of transmitting large amounts of data from the server side to the client, this is not possible for the actual HTTP request body of a callback that sends this data to the server side.

Grids are notoriously using huge JSON structures of several megabytes. Transmitting this data via the network can make the application feel sluggish.

Solution
We could have an option to compress the body of a server side callback on the client side. We could introduce two new parameters for the callback:

compress_payload: bool = False: If True, the callback request payload will be compressed using gzip compression before being sent to the server. Defaults to False.
compress_threshold: int = 5_000: The size threshold in bytes above which the payload will be compressed when compress_payload is True. Set to 0 to always compress regardless of size. Defaults to 5,000 bytes (5 kB).

Alternatives
This can partially be simulated by using client-side callbacks that compress and copy the data to a compressed dcc.Store and then rewire the callbacks to use that store and decompress on the server side. However, this bloats the code and application state.

See referenced PR for more details: https://github.com/plotly/dash/pull/3925

Ngôn ngữ chính
Python
Star
24.4k
Fork
2.3k
Merge trung bình
1 ngày 21 giờ
Pull request đã merge (30 ngày)
19

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của plotly/dash

Tất cả issue của plotly/dash

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.