Skip to content

Commit fb98254

Browse files
committed
feat: configure Envoy to compress additional response types
Adds a number of Postgrest response types for compression by Envoy.
1 parent f9cee1e commit fb98254

File tree

2 files changed

+41
-4
lines changed

2 files changed

+41
-4
lines changed

ansible/files/envoy_config/lds.yaml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,41 @@ resources:
8989
source_codes:
9090
remove_apikey_query_parameter:
9191
filename: /etc/envoy/remove_apikey_query_parameter.lua
92+
- name: envoy.filters.http.compressor
93+
typed_config:
94+
'@type': >-
95+
type.googleapis.com/envoy.extensions.filters.http.compressor.v3.Compressor
96+
response_direction_config:
97+
common_config:
98+
min_content_length: 100
99+
content_type:
100+
- application/vnd.pgrst.object+json
101+
- application/vnd.pgrst.array+json
102+
- application/openapi+json
103+
- application/geo+json
104+
- text/csv
105+
- application/vnd.pgrst.plan
106+
- application/vnd.pgrst.object
107+
- application/vnd.pgrst.array
108+
- application/javascript
109+
- application/json
110+
- application/xhtml+xml
111+
- image/svg+xml
112+
- text/css
113+
- text/html
114+
- text/plain
115+
- text/xml
116+
disable_on_etag_header: true
117+
request_direction_config:
118+
common_config:
119+
enabled:
120+
default_value: false
121+
runtime_key: request_compressor_enabled
122+
compressor_library:
123+
name: text_optimized
124+
typed_config:
125+
'@type': >-
126+
type.googleapis.com/envoy.extensions.compression.gzip.compressor.v3.Gzip
92127
- name: envoy.filters.http.router
93128
typed_config:
94129
'@type': >-
@@ -181,12 +216,14 @@ resources:
181216
retry_policy:
182217
num_retries: 3
183218
retry_on: 5xx
219+
timeout: 35s
184220
typed_per_filter_config: *ref_0
185221
- match:
186222
prefix: /auth/v1/
187223
route:
188224
cluster: gotrue
189225
prefix_rewrite: /
226+
timeout: 35s
190227
- match:
191228
prefix: /rest/v1/
192229
query_parameters:
@@ -197,7 +234,7 @@ resources:
197234
route:
198235
cluster: postgrest
199236
prefix_rewrite: /
200-
timeout: 120s
237+
timeout: 125s
201238
typed_per_filter_config:
202239
envoy.filters.http.lua:
203240
'@type': >-
@@ -210,7 +247,7 @@ resources:
210247
route:
211248
cluster: postgrest
212249
prefix_rewrite: /
213-
timeout: 120s
250+
timeout: 125s
214251
- match:
215252
prefix: /rest-admin/v1/
216253
query_parameters:
@@ -242,7 +279,7 @@ resources:
242279
route:
243280
cluster: postgrest
244281
prefix_rewrite: /rpc/graphql
245-
timeout: 120s
282+
timeout: 125s
246283
- match:
247284
prefix: /admin/v1/
248285
route:

common-nix.vars.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.6.1.115"
1+
postgres-version = "15.6.1.116"

0 commit comments

Comments
 (0)