Enable Compression

In ISPmanager you can configure compression of a website's static content which includes files that can be easily modified (images, music, video, etc.). As a rule, such files consume much space and slow down your website.
Content compression is available if you use the Nginx or OpenLiteSpeed web server. To configure compression for:
  • Nginx — when creating or editing a WWW domain, enable the Сompression option and specify the Compression level. The maximum compression value is 9. The minimum is 1. The recommended value is 5.
  • OpenLiteSpeed — when creating or editing a WWW domain, enable the Сompression option. The compression level for OpenLiteSpeed is not configurable.

Technical details for Nginx

The ngx_http_gzip_module module is a filter that compresses a request with gzip, enabling to reduce data size. If the compression is enabled, the following information is added to the Nginx configuration file for the WWW-domain:
Nginx configuration file
gzip on;
gzip_comp_level <compression level>;
gzip_disable "msie6";
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
details
gzip on — enable the gzip compression.gzip_comp_level — sets the compression level.gzip_disable "msie6" — disables the gzip compression for requests with the “User-Agent” heading fields that match specified regular expressions. The special mask “msie6” corresponds to the “MSIE [4-6]\.” regular expression, but it is faster.gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript — sets the data type that will be compressed. “text/html” are always compressed.

Perform the following steps to modify a list of data types:
    .1 Add the variable into the ISPmanager configuration file (the default location is /usr/local/mgr5/etc/ispmgr.conf): ISPmanager configuration file
path nginx-gzip-types <data types>
E.g.:ISPmanager configuration file
path nginx-gzip-types text/plain text/css
2. Restart the control panel
/usr/local/mgr5/sbin/mgrctl -m ispmgr exit
    .3To apply the settings to the existing WWW-domains go to Domains → WWW-domains → Website management → Website settings and click Ok.
For more information about ngx_http_gzip_module please refer to the official website.