gzip Compressing Dengan HaProxy

Malam tadi buat performance test menggunakan website GTmetrix, ada beberapa area yang kena adjust sikit supaya performance website jadi lebih baik.

Tapi malam tadi hanya sempat untuk tambah gzip compression di bahagian reverse proxy dan hasil test untuk kali kedua agak positif.

Sebelum

Selepas

Untuk buat adjustment dalam HaProxy cuma perlu tambah dua parameter iaitu;

   compression algo gzip
   compression type text/html text/plain text/css text/javascript text/js

Jadi HaProxy configuration selepas tambah akan jadi macam ini untuk bahagian backend:

backend www-backend
   redirect scheme https if !{ ssl_fc }
   # Get from cache / put in cache
   compression algo gzip
   compression type text/html text/plain text/css text/javascript text/js
   server www-1 127.0.0.1:8080 maxconn 30

Lepas ini, nak check Score yang dapat C, rasa boleh adjust lagi untuk improve.

URL references:
https://www.haproxy.com/blog/haproxy-and-gzip-compression/
https://cbonte.github.io/haproxy-dconv/configuration-1.5.html

Leave a Comment