Documentation Center

Compressing large files

You can configure the LiveContent S1000D server to automatically compress large files before transmitting them to the browser to improve the time it takes to load some graphics and other large files in an IETP.

Some types of content that can be compressed include SVG, Javascript, JSON, HTML, XML, CSS, PDF, and plain text.

Server-side HTTP compression is applied only to content read directly from the server file system. Content generated dynamically (via API calls that include database content requests), transformed content, or similarly server-processed content is not compressed.

To enable file compression for a collection, set the following configuration items in the <ietm/> section of its associated wietmsd_prg.xml configuration file.
Configuration itemDescription
send_compressed_contentBy default, files are transmitted uncompressed; set this configuration item to 1 to enable compression.
need_compress_content_file_typeSpecify a comma-delimited list of the file extensions of types of content to be compressed.
min_file_size_kbSpecify, in kilobytes, the minimum file size to be compressed. Files smaller than the size specified here are transmitted uncompressed.

Sample wietmsd_prg.xml settings

The following is a sample fragment of a wietmsd_prg.xml configuration file set to enable compression for content in its associated collections.
<ietm>

. . . 

    <configitem name="send_compressed_content">

        <comment>by defaults the file content will be sent out as it is. If this value is set to 1 it will be compressed before sending out</comment>

        <value>1</value>

    </configitem>

    <configitem name="need_compress_content_file_type">

        <comment>list of the file extensions need to be compressed, like 'svg,txt,xml,doc'</comment>

        <value>svg,html,xml,cgm,pdf,js</value>

    </configitem>

    <configitem name="min_file_size_kb">

        <comment>100 for 100kb</comment>

        <value>25</value>

    </configitem>

. . .

</ietm>

In this example, the server is configured to compress files 100 kb or larger with the following extensions before transmitting them to the browser.
  • .svg
  • .html
  • .xml
  • .cgm
  • .pdf
  • .js
All other files are transmitted in their original, uncompressed formats.