community postIntegration & APIscommunity - not Microsoftreviewed - checked by Opus

Dynamics 365 Business Central: compressing API responses at max.

This post explains how to use Brotli compression instead of gzip to reduce the size of OData API responses from Business Central. Brotli significantly decreases bandwidth usage and transfer times for high-volume API calls by achieving better compression ratios than the default gzip algorithm.

post Stefano Demiliani

Stefano Demiliani · 2025-06-23 · 761 words · about 3 min

"Brotli is a high-efficiency, lossless compression algorithm developed by Google that achieves higher compression ratios compared to traditional algorithms such as gzip."

Key points

  • Business Central APIs compress responses with gzip by default, negotiated via Accept-Encoding and Content-Encoding headers
  • Sending Accept-Encoding: br makes the API return Brotli-compressed responses, which were much smaller in tests on a custom Item API
  • For 10000 items the response dropped from roughly 11 MB with gzip to about 515 KB with Brotli
  • In C#, an HttpClient with AutomaticDecompression set to Brotli and a br accept header handles decompression transparently
  • Brotli may add slight server overhead, though the author saw no significant difference

Quotes

  • “Brotli is a high-efficiency, lossless compression algorithm developed by Google that achieves higher compression ratios compared to traditional algorithms such as gzip.” (Explains why Brotli is superior to the default compression method for reducing data transmission size)

AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

Context

  • Features: OData API compression, Brotli compression, gzip compression, HTTP compression, API response optimization

Source: Stefano Demiliani, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.