10.2 Understanding HTTP Compression
HTTP compression, otherwise known as content encoding, is a publicly defined way to compress textual contents transferred from Web servers to browsers. HTTP compression uses public domain compression algorithms to compress XHTML, JavaScript, CSS, and other text files at the server.
By default, the following MIME types can be compressed by the FortiBalancer appliance for all the browsers: Text (text/plain)
- HTML (text/HTML)
- XML (text/XML)
The following MIME types are able to be compressed by the FortiBalancer appliance for certain browsers via “http compression policy useragent” command:
- Java Scripts (application/x-javascript)
- Cascade Style Sheets (text/css, application/x-pointplus)
- PDF documents (application/pdf)
- PPT documents (application/powerpoint)
- XLS documents (application/MSExcel)
- DOC (application/MSWord)
Now, if Administrators do not want to compress some textual contents from Web servers to browsers, they are able to configure a url-exclude HTTP compression rule for the client request via the the “http compression policy urlexclude” command. If the URL of the client request matches the rule, the textual content from the Web servers to the browsers will not be compressed even if HTTP compression is on.
Not all files are suitable for compression. For obvious reasons, files that are already compressed, such as JPEGs, GIFs, PNGs, movies, and bundled contents (e.g., Zip, Gzip, and bzip2 files) are not going to be compressed appreciably further with a simple HTTP compression filter. Therefore, you are not going to get much benefit from compressing these files or a site that relies heavily on them.
Note: For the data files in very small size, the size of the compressed data may be larger than the original data size.