Skip to content

Remove hardcoded gzip compression #66574

Open

Description

@Forza-tng

if (!str_contains($header, 'gzip')) {

$response = new FileDisplayResponse($file, Http::STATUS_OK, ['Content-Type' => 'text/css']);

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapenhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions