Remove hardcoded gzip compression

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
backend, performance

Hướng nghiên cứu

Start in lib/private/AppFramework/Middleware/CompressionMiddleware.php near line 41 and core/Controller/CssController.php near line 61, where the Accept-Encoding header is checked with str_contains for 'gzip'. Look at how the header is parsed today and where a config option would be read. Done when a request sending gzip;q=0 receives an uncompressed response, and the internal compression can be turned off through the proposed config setting, with tests covering both cases.

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

Mô tả

0. Needs triage enhancement

https://github.com/nextcloud/server/blob/756513a1f82b87a93325e25c7ce59204bc3d3089/lib/private/AppFramework/Middleware/CompressionMiddleware.php#L41

https://github.com/nextcloud/server/blob/04556a42112151ca21d2e3a81451b4b8787107cb/core/Controller/CssController.php#L61

Nextcloud is hardcoding some of its output as gzip, and doesn't allow for other encodings a browser may support.

I propose to have a config option to enable or disable internal compression.

A lot of people use compression via a reverse proxy, which may also support additional compression options like brotli and zstd. It would also move some of the encoding load from the php-fpm server to the reverse proxy.

There is also a tiny problem with the string matching, as it would provide a gzip encoding to a client that specifically states a qvalue of gzip;q=0. A qvalue of 0 means "not acceptable".

if (str_contains($encoding, 'gzip')) { 

https://httpwg.org/specs/rfc9110.html#field.accept-encoding

Ngôn ngữ chính
PHP
Star
37.6k
Fork
5.4k
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
623

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 nextcloud/server

Tất cả issue của nextcloud/server

Issue tương tự

Thêm issue về PHP

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.