Project

General

Profile

Actions

Feature #2190

closed

Server side compression

Added by Bernhard Koschiček-Krombholz about 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Category:
Administration
Target version:
Start date:
2024-02-19
Estimated time:

Description

Stefan (Probst) suggested that we use server side compression to improve request performance. We can use gzip or Brotli, but Brotli will be the better solution.
Resources: https://www.cloudways.com/blog/brotli-vs-gzip/

Update
We decided to use Brotli, there even is a Debian package available.


Files

2024-02-20_19-41.png (110 KB) 2024-02-20_19-41.png Bernhard Koschiček-Krombholz, 2024-02-20 19:43
Actions #1

Updated by Bernhard Koschiček-Krombholz about 2 months ago

I don't know how trustworthy this site is, but according to this globally 97% of the used browsers support brotli.
I tested it today on my server, it works quite good and will make a performance boost.

Installation:

  1. Install brotly
    sudo apt install brotli
    
  2. Enable apache mod
    sudo a2enmod brotli
    
  3. Add to virtual host configuration
    <IfModule mod_brotli.c>
         AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript application/json 
    </IfModule>
    
  4. Restart Apache
    sudo service apache2 restart
    

And that's it.

Actions #2

Updated by Stefan Probst about 2 months ago

cool!

I don't know how trustworthy this site is, but according to caniuse.com

very!

Actions #3

Updated by Alexander Watzinger about 2 months ago

  • Status changed from Assigned to In Progress

Thanks for your inputs and instructions. I activated it on trinity for https://demo-dev.openatlas.eu.
Not sure how to test this but according to https://tools.keycdn.com/brotli-test it now works for this domain.

In case there are no problems and no further input from your side (e.g. Bernhard and Stefan) I will continue it implementing for the other sides on trinity and at the ACDH-CH.
For NHM I leave it up to Bernhard ;)

Actions #4

Updated by Alexander Watzinger about 2 months ago

  • Target version changed from 8.4.0 to 8.2.0
Actions #5

Updated by Alexander Watzinger about 2 months ago

  • Description updated (diff)
Actions #6

Updated by Alexander Watzinger about 2 months ago

  • Description updated (diff)
Actions #7

Updated by Alexander Watzinger about 2 months ago

  • Description updated (diff)
Actions #8

Updated by Bernhard Koschiček-Krombholz about 2 months ago

If you make an API request (e.g. /api/system_class/place) and the Content-Encoding is br than it worked.
Ok, then let's implement it.

Actions #9

Updated by Stefan Probst about 2 months ago

thanks for implementing!

also, for reference: a client can tell the server about supported compression formats with the "Accept-Encoding" request header.

Actions #10

Updated by Alexander Watzinger about 2 months ago

  • Description updated (diff)

Thank you for the advice :) it's easy to implement and helps a lot with larger data sets.
I decided to document it in Debian server installation, which is also linked in the install notes, using the nicely prepared description from Bernhard.

Actions #11

Updated by Alexander Watzinger about 2 months ago

  • Description updated (diff)
  • Status changed from In Progress to Closed
Actions

Also available in: Atom PDF