Powered by Zoomin Software. For more details please contactZoomin

What's New in MarkLogic 11

HTTP Compression and Chunking

  • Last Updated: April 14, 2026
  • 2 minute read
    • MarkLogic Server
    • Version 11.0
    • Documentation

MarkLogic 11 adds out-of-the-box support for automatic HTTP compression and chunking.

HTTP Compression

Prior to MarkLogic 11, HTTP compression on standard endpoints (such as /v1/rows) was not available. HTTP compression could be added to custom REST extensions via the use of xdmp.gzip to compress the response. However, this required custom code and lacked the ability to stream the response. For example, a large JSON document with an array with a million rows would have to be compressed in memory prior to returning the response.

MarkLogic 11 now supports compressing of data at the HTTP layer. This means that if clients specify the Accept-Encoding: gzip HTTP header, HTTP compression will be done for all out of the box endpoints. And, custom endpoints will not need to use custom code to compress data. Custom endpoints can leverage streaming results, and the HTTP layer will compress the results on the fly.

Important:

Any custom code that looks for the 'Accept-Encoding: gzip` HTTP header and performs compression must be removed. If such code is not removed, the results will be compressed twice, rendering them unusable by the client.

Custom HTTP endpoints can override the client request header and turn on or off the HTTP compression via a new built-in function xdmp.setResponseCompression(). This function also allows the compression level to be set.

Since most browsers send the Accept-Encoding: gzip HTTP header by default, all traffic to the MarkLogic built-in applications, such as the Admin UI and Query Console, will now be compressed.

Important:

In MarkLogic 11, gzip compression was added to the MarkLogic HTTP AppServer. However, the AWS Classic Load Balancer does not support gzip compression. Therefore, if you attempt to use the Classic Load Balancer after upgrading to MarkLogic 11, the Admin Interface and Query Console will not load properly, triggering a 502 Bad Gateway error.

To work around this issue, you may disable compression by adding the trace event HTTPServer Disable Compression. This trace event completely disables compression in MarkLogic 11, reverting to MarkLogic 10 behavior. For steps on enabling trace events, refer to the Knowledge Base article How to use diagnostic trace events.

HTTP Chunking

MarkLogic 11 adds the ability to use HTTP chunked transfer encoding. This adds the ability to report errors during the streaming of large results over HTTP.

HTTP chunking is activated in one of two ways:

  1. The client includes the TE:trailers request header

  2. Custom HTTP endpoints use the built-in function xdmp.setResponseChunkedEncoding(). Custom trailers can be added using xdmp.addResponseTrailer() function

If HTTP chunking has been activated by one of the above mechanisms, MarkLogic will send the following trailers (including the header):

  • ML-CONTENT-SHA256 - The SHA256 of the content that was sent (this can be used to check the all of the data that was sent was received)

  • ML-ERROR-CODE - The error code if an error occurred, or "NONE" if there wasn't an error

  • ML-ERROR-MESSAGE - The error message if an error occurred, or "NONE" if there wasn't an error

  • Any custom trailers added via xdmp.addResponseTrailer()

TitleResults for “How to create a CRG?”Also Available inAlert