This guide covers the Layer0 response compression support.
When requesting data via HTTP from the Layer0 servers, browsers include the
accept-encoding header to indicate which data compression formats the browser supports. Modern browsers accept multiple compression formats, Accept-Encoding Header Details are here. This header is required by Layer0 to trigger compression of responses.
gzipfor all versions
br(Brotli) for versions >=
To enable Brotli (
br) compression you need to ensure your project uses a version of
4.11.0. To upgrade
@layer0 to the latest version in your project use
0 use latest and redeploy your project.
When Layer0 servers receive a request they inspect the
accept-encoding header. The following logic is used to determine response compression:
- If the response is not a compressible type, return uncompressed.
- Else if
bris found and the
@layer0version is >=
4.11.0then compress the response using Brotli.
- Else if
gzipis found, then compress the response using gzip.
- Else no compression is used.
A response is considered compressible if the
content-type contains one of these strings:
or the url ends in one of these file extensions: