Anniversary Sale · up to 80% off all librariesEnds Nov 9Shop now
SOFTTDocs
Features

Brotli Compression

Serve the ESP-DASH Pro dashboard with Brotli instead of gzip compression to reduce flash usage, including browser and HTTPS requirements.

ESP-DASH Pro feature. This functionality is available only in the commercial edition of ESP-DASH.

ESP-DASH Pro stores the dashboard webpage in flash in compressed form. By default it uses gzip. Enabling Brotli compression reduces the size of the stored webpage and frees flash space for your application.

Brotli logo

In the current release, the embedded webpage is 178,415 bytes with gzip and 151,846 bytes with Brotli, a reduction of about 15%. The exact figures vary between releases.

Browser requirements

Brotli compression is supported only by Safari over unencrypted HTTP. Other browsers, such as Chrome, Edge and Firefox, accept Brotli-encoded responses only over HTTPS. The dashboard is always sent with Content-Encoding: br when Brotli is enabled, so a browser that does not accept Brotli cannot load it.

Brotli compression is disabled by default. Enable it only if every browser that will access your dashboard meets the requirements above.

Enable Brotli compression

Brotli compression is controlled by the DASH_USE_BROTLI_COMPRESSION macro. Set it to 1 to enable Brotli or 0 to use gzip.

Open edp.h

Open src/edp.h in the ESP-DASH Pro library folder.

Change the macro

Locate DASH_USE_BROTLI_COMPRESSION and change its value from 0 to 1:

edp.h
#ifndef DASH_USE_BROTLI_COMPRESSION
    #define DASH_USE_BROTLI_COMPRESSION 1
#endif

Rebuild

Save the file, then compile and upload your sketch again.

Changes to edp.h are overwritten when you update the library. After an update, apply the change again or use a build flag.

On this page