Content compression

Last change on 2021-07-07 • Created on 2020-01-20

Activate compression

mod_deflate (for Gzip) is installed on our servers. You can activate it by going to "Services; Webserver Extensions".

Individual rules for compression

You can use the following lines in a .htaccess file to customize the compression, for example, by content type:

FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE "%{Content_Type} -strmatch 'text/html*'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} -strmatch 'text/plain*'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} -strmatch 'text/xml*'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} -strmatch 'text/css*'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} -strmatch 'application/x-javascript*'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} -strmatch 'application/javascript*'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} -strmatch 'application/ecmascript*'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} -strmatch 'text/javascript*'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} -strmatch 'application/rss+xml*'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} -strmatch 'application/json*'"
FilterChain COMPRESS
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no

This will compress the most common content types. You may add your own content types if you need.

Table of Contents