File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
content/en/docs/reference/using-api Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -284,6 +284,36 @@ Content-Type: application/json
284
284
<followed by regular watch stream starting from resourceVersion="10245">
285
285
```
286
286
287
+ ## Response compression
288
+
289
+ {{< feature-state for_k8s_version="v1.16" state="beta" >}}
290
+
291
+ ` APIResponseCompression ` is an option that allows the API server to compress the responses for ** get**
292
+ and ** list** requests, reducing the network bandwidth and improving the performance of large-scale clusters.
293
+ It is enabled by default since Kubernetes 1.16 and it can be disabled by including
294
+ ` APIResponseCompression=false ` in the ` --feature-gates ` flag on the API server.
295
+
296
+ API response compression can significantly reduce the size of the response, especially for large resources or
297
+ [ collections] ( /docs/reference/using-api/api-concepts/#collections ) .
298
+ For example, a ** list** request for pods can return hundreds of kilobytes or even megabytes of data,
299
+ depending on the number of pods and their attributes. By compressing the response, the network bandwidth
300
+ can be saved and the latency can be reduced.
301
+
302
+ To verify if ` APIResponseCompression ` is working, you can send a ** get** or ** list** request to the
303
+ API server with an ` Accept-Encoding ` header, and check the response size and headers. For example:
304
+
305
+ ``` console
306
+ GET /api/v1/pods
307
+ Accept-Encoding: gzip
308
+ ---
309
+ 200 OK
310
+ Content-Type: application/json
311
+ content-encoding: gzip
312
+ ...
313
+ ```
314
+
315
+ The ` content-encoding ` header indicates that the response is compressed with ` gzip ` .
316
+
287
317
## Retrieving large results sets in chunks
288
318
289
319
{{< feature-state for_k8s_version="v1.9" state="beta" >}}
You can’t perform that action at this time.
0 commit comments