Remove hardcoded gzip compression

Offen
#66,574 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
php
Bereich
backend, performance

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
PHP
Sterne
37.6k
Forks
5.4k
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
623

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nextcloud/server

Alle Issues in nextcloud/server

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.