Via Cà Matta 2 - Peschiera Borromeo (MI)
+39 02 00704272
info@synaptica.info

Apache enable compress on reverse proxy

Digital solution partner

Apache enable compress on reverse proxy

Through Apache it is possible to enable the compression of the contents before they are sent to the http client (browser generally), all this through the “mod_deflate” module.

To enable the deflate module you need to run the “a2enmod deflate” command and restart the apache service.

A very interesting thing is that this functionality is usable even if apache is configured as a reverse proxy by simply adding a couple of lines:

“AddOutputFilterByType DEFLATE text / html text / plain text / xml text / css text / javascript application / javascript”

and

SetOutputFilter INFLATE; DEFLATE

The first line allows you to specify the contents that will be compressed / decompressed in the request / response and the second one inside the “location” tag says to apply the mod_deflate to the contents that come from your server. below is an example of configuration: