Edge cache file compression
The Brotli compression and Gzip compression methods are both supported and are applied to the responses of qualifying requests.
Brotli or Gzip compression is applied to:
- Files that are stored in the VIP File System or deployed from an application’s wpcomvip GitHub repository and are of the file type:
css|js|json|xml|rss|svg|svgz|ico|txt|eot|ttf|atom
. - Responses that specify a
Content-Length
header and have a value of 500 bytes or greater. - Responses with
chunked
transfer encoding.
The compression method that is applied to a file is dependent on the value of the Accept-Encoding
request header sent by the user’s client. If the Accept-Encoding
request header includes both Brotli and Gzip (e.g. Accept-Encoding: gzip, br
) the response will be compressed with Brotli.
Files larger than 1 GB will not have any compression applied to them and will not be stored in the cache.
Troubleshooting
Brotli compression might not work as expected for sites behind a reverse proxy configuration. The Accept-Encoding
header is typically handled by the reverse proxy provider before the request is forwarded to WPVIP’s edge cache servers. Some reverse proxy providers ignore the br
value of the Accept-Encoding
header, and only forward the gzip
value. If Brotli compression is expected but not being applied for responses from a site behind a reverse proxy, investigate adjustments to settings at the reverse proxy layer to resolve the issue.
Last updated: May 07, 2024