Remove hardcoded gzip compression

オープン
#66,574 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
PHP
スター
37.6k
フォーク
5.4k
平均マージ
1日 13時間
マージ済み PR(30日)
623

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nextcloud/server のほかの issue

nextcloud/server の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。