Skip to content

Commit d2fd531

Browse files
committed
feat: configure Envoy to compress additional response types
Adds a number of Postgrest response types for compression by Envoy, enables gzip and brotli compression, and defaults to `br` compression (e.g. for `Accept-Encoding: *`).
1 parent 90d602a commit d2fd531

File tree

2 files changed

+72
-2
lines changed

2 files changed

+72
-2
lines changed

Diff for: ansible/files/envoy_config/lds.yaml

+71-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,78 @@ resources:
103103
request_handle
104104
:headers()
105105
:replace(":path", path:gsub("&=[^&]*", ""):gsub("?=[^&]*$", ""):gsub("?=[^&]*&", "?"))
106+
106107
end
108+
- name: envoy.filters.http.compressor.brotli
109+
typed_config:
110+
'@type': >-
111+
type.googleapis.com/envoy.extensions.filters.http.compressor.v3.Compressor
112+
response_direction_config:
113+
common_config:
114+
min_content_length: 100
115+
content_type:
116+
- application/vnd.pgrst.object+json
117+
- application/vnd.pgrst.array+json
118+
- application/openapi+json
119+
- application/geo+json
120+
- text/csv
121+
- application/vnd.pgrst.plan
122+
- application/vnd.pgrst.object
123+
- application/vnd.pgrst.array
124+
- application/javascript
125+
- application/json
126+
- application/xhtml+xml
127+
- image/svg+xml
128+
- text/css
129+
- text/html
130+
- text/plain
131+
- text/xml
132+
disable_on_etag_header: true
133+
request_direction_config:
134+
common_config:
135+
enabled:
136+
default_value: false
137+
runtime_key: request_compressor_enabled
138+
compressor_library:
139+
name: text_optimized
140+
typed_config:
141+
'@type': >-
142+
type.googleapis.com/envoy.extensions.compression.brotli.compressor.v3.Brotli
143+
- name: envoy.filters.http.compressor.gzip
144+
typed_config:
145+
'@type': >-
146+
type.googleapis.com/envoy.extensions.filters.http.compressor.v3.Compressor
147+
response_direction_config:
148+
common_config:
149+
min_content_length: 100
150+
content_type:
151+
- application/vnd.pgrst.object+json
152+
- application/vnd.pgrst.array+json
153+
- application/openapi+json
154+
- application/geo+json
155+
- text/csv
156+
- application/vnd.pgrst.plan
157+
- application/vnd.pgrst.object
158+
- application/vnd.pgrst.array
159+
- application/javascript
160+
- application/json
161+
- application/xhtml+xml
162+
- image/svg+xml
163+
- text/css
164+
- text/html
165+
- text/plain
166+
- text/xml
167+
disable_on_etag_header: true
168+
request_direction_config:
169+
common_config:
170+
enabled:
171+
default_value: false
172+
runtime_key: request_compressor_enabled
173+
compressor_library:
174+
name: text_optimized
175+
typed_config:
176+
'@type': >-
177+
type.googleapis.com/envoy.extensions.compression.gzip.compressor.v3.Gzip
107178
- name: envoy.filters.http.router
108179
typed_config:
109180
'@type': >-
@@ -343,4 +414,3 @@ resources:
343414
filename: /etc/envoy/fullChain.pem
344415
private_key:
345416
filename: /etc/envoy/privKey.pem
346-

Diff for: common-nix.vars.pkr.hcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.6.1.118"
1+
postgres-version = "15.6.1.119"

0 commit comments

Comments
 (0)