Compression¶
OpenLiteSpeed's default gzip and Brotli Compression settings should be appropriate for most situations.
Server-Level Compression Configuration¶
The server level Enable Compression setting is a master switch, and is enabled by default. If you set it to No
, it will disable compression server-wide, overriding all virtual-host-level compression settings.
- Compressible Types is a comma-separated list of MIME types that may be compressed. You may use wildcards for MIME types, for example,
*/*
, ortext/*
. You can put!
in front of a MIME type to exclude it. The order of the list is important if you use!
. A list liketext/*, !text/css, !text/js
will compress all text files except for CSS and JS. MIME type must be matched before compression is considered. It controls both static and dynamic content and mod_gzip. - Enable Dynamic GZIP Compression will be effective only if gzip compression is enabled.
- GZIP Compression Level (Dynamic Content) ranges from
1
(Minimum) to9
(Maximum). - If you set the Brotli Compression Level (Static File) to
0
, then Brotli is disabled at the server level. - Use Min Static File Size to specify the smallest size static file for which the server will create a corresponding compressed file. Any files that fall below the threshold will not be compressed by the server during initial access. However, they will still be compressed dynamically via mod_gzip. Static files are compressed only once, so even the smallest of files would be better off generated once at initial access than dynamically generated at runtime via mod_gzip.
Virtual Host level Compression Configuration¶
You can set Enable GZIP Compression and Enable Brotli Compression separately at the virtual host level in the virtual host's General settings.
Last update: July 17, 2024