Impact enabling compression via .htaccess

9 views
Skip to first unread message

Tore Van Grembergen

unread,
Jul 6, 2022, 2:23:08 AMJul 6
to Fusio
Dear All,

see below .htaccess code.
if this is added into the .htaccess it enables compression of the (mainly text) sent out by the webserver.
With regards to webserver performance, this is considered to be best practice.
Does anybody has experience on the impact of adding this on an API gateway ?
I noticed on the front end a small performance increase, but does this also happen with the API requests ? 

Kind regards

Tore



# enable gzip
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE

BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch \bMSIE\s(7|8) !no-gzip !gzip-only-text/html

# Compress text, html, javascript, css, xml:
#remark : woff and woff2 are already compressed, thus not added into the list

SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|ico)$ no-gzip dont-vary
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/js
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-font-opentype


</IfModule>


Christoph Kappestein

unread,
Jul 6, 2022, 4:59:11 PMJul 6
to Fusio
Hi,

ok, so in general since with Fusio you build mainly APIs which return application/json content it is probably not really required, but it could be useful for the apps which we also provide since those are mostly html and javascript files.
Also I would recommend to add those rules directly to your vhost config, so that the apache does not need to parse the .htaccess file on every request.

best regards
Christoph
Reply all
Reply to author
Forward
0 new messages