clarin-eric / discovery-service-frontend

SPF Central Discovery Service Backend
https://www.clarin.eu/content/clarin-discovery-service
GNU General Public License v3.0
0 stars 2 forks source link

Check if HTTP compression is enabled for large files #37

Closed dietervu closed 6 years ago

dietervu commented 6 years ago

The old discovery service leads to a download of 837 KB in total, the new one to 1.79 MB. As far as I can see, for none of the files the Content-encoding: gzip is returned by the HTTP server. This was the case for the old one. Would be good to optimize this before putting the new discovery service into production.

andmor- commented 6 years ago

The problem seems to be fixed by adding following to the nginx config file inside the image (/etc/nginx/conf.d/discovery.conf) under the server context

    gzip              on;
    gzip_disable      "msie6";
    gzip_proxied      any;
    gzip_http_version 1.0;
    gzip_vary         on;
    gzip_min_length   200;
    gzip_buffers      16 8k;
    gzip_types        text/plain
                      text/xml
                      text/css
                      text/comma-separated-values
                      text/javascript
                      application/javascript
                      application/x-javascript
                      application/atom+xml
                      application/json
                      application/xml;
WillemElbers commented 6 years ago

Confirmed that compression is now enabled.

andmor- commented 6 years ago

Is the change persistent? I did not figure out how to persist the change.

WillemElbers commented 6 years ago

As @andmor mentioned this has to be included in the nginx serving the static javascript: https://gitlab.com/CLARIN-ERIC/docker-aai-discovery/tree/new

WillemElbers commented 6 years ago

Now added in https://gitlab.com/CLARIN-ERIC/docker-aai-discovery/commit/341d3d5d4f74d3f79a013f7e1ba6127a673a825b