blob: 8cfaf2d9c876fa11d483ed440992afe2ed8dccb1 [file]
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
######################################################################
#flags and options are:
#
# enabled: default true, set true/false to enable/disable plugin for specific host
#
# remove-accept-encoding: this sets if the plugin should hide the accept encoding from origin servers
# - to ease the load on the origins
# - for when the proxy parses responses, and the resulting compression/decompression
# is wasteful
#
# cache: when true, caches the compressed response; when false, caches only the uncompressed
# response and compresses on-the-fly from cache. Vary: Accept-Encoding handles alternates.
#
# compressible-content-type: wildcard pattern for matching compressible content types
#
# allow: wildcard pattern for allow/disallowing compression on urls
# - prefix pattern with ! to disallow
#
# compressible-status-code: a comma separated list of status codes in which to enable compression
#
# minimum-content-length: minimum content length for compression to be enabled (in bytes)
# - this setting only applies if the origin response has a Content-Length header
#
# gzip-compression-level: compression level for gzip (1-9, default 6)
# - 1 is fastest compression (lowest compression ratio)
# - 9 is slowest compression (highest compression ratio)
#
# brotli-compression-level: compression level for brotli (0-11, default 6)
# - 0 is fastest compression (lowest compression ratio)
# - 11 is slowest compression (highest compression ratio)
#
# brotli-lgwin: window size for brotli compression (10-24, default 16)
# - larger values provide better compression but use more memory
# - 10: 1KB window, 16: 64KB window, 24: 16MB window
#
# zstd-compression-level: compression level for zstandard (1-22, default 12)
# - 1 is fastest compression (lowest compression ratio)
# - 22 is slowest compression (highest compression ratio)
#
######################################################################
#first, we configure the default/global plugin behaviour
enabled true
remove-accept-encoding true
cache false
compressible-content-type text/*
compressible-content-type *javascript*
#disabling is possible too
compressible-content-type !text/javascript
compressible-status-code 200
allow !/notthis/*.js
allow !/notthat*
allow !*/bla*
minimum-content-length 1024
#supported algorithms
supported-algorithms br,gzip,zstd
# Compression level settings (optional)
gzip-compression-level 6
brotli-compression-level 6
brotli-lgwin 16
zstd-compression-level 12
#override the global configuration for a host.
#www.foo.nl does NOT inherit anything
[www.foo.nl]
enabled true
cache true
remove-accept-encoding true
compressible-content-type text/*
compressible-status-code 200,206,409
minimum-content-length 1024
# Custom compression settings for this host
gzip-compression-level 8
brotli-compression-level 9
brotli-lgwin 20
zstd-compression-level 15
allow /this/*.js
allow !/notthis/*.js
allow !/notthat*