hyperknot / openfreemap

Free and open-source map hosting solution with custom styles for websites and apps, using OpenStreetMap data
https://openfreemap.org/
Other
2.86k stars 58 forks source link

Static gzip compression #43

Open bouk opened 2 days ago

bouk commented 2 days ago

Hi there, thanks for this amazing project.

I think you can gain some performance and lower serving CPU usage by enabling static gzip compression. If you combine it with ngx_http_gunzip_module you can lower the size of the tiles on disk while still allowing non-gzip clients to request files. I think it might allow nginx to sendfile the compressed files directly (though you might have to enable kTLS as well). And you can spend some CPU to compress the files harder (perhaps using zopfli) to save some bandwidth.

I suggest using pigz to compress the files, it's a lot faster than gzip.