TeamPiped / Piped-Docker

MIT License
47 stars 35 forks source link

Add more GZIP options for nginx #18

Closed httpjamesm closed 2 years ago

httpjamesm commented 2 years ago

GZIP in nginx requires further configuration than gzip on to properly work and have an impact on performance.

I suggest adding the following lines to the nginx config to compress assets more for faster loading:


        gzip_vary on;
        gzip_proxied any;
        gzip_comp_level 6;
        gzip_buffers 16 8k;
        gzip_http_version 1.1;
        gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
        # Specify the minimum length of the response to compress (default 20)
        gzip_min_length 500;
FireMasterK commented 2 years ago

But why not use this in your existing reverse proxy? This wouldn't allow users to disable gzip if they wanted

httpjamesm commented 2 years ago

Well judging by the existing config, it seemed you wanted to enable gzip.

You can also make it an option in the docker compose file to enable gzip instead.