Skip to content

Commit

Permalink
Merge pull request #4056 from OpenLiberty/covener-patch-1
Browse files Browse the repository at this point in the history
simplify and differentiate examples
  • Loading branch information
dmuelle authored Oct 1, 2024
2 parents ea46a09 + c16b388 commit 92df090
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions posts/2020-04-22-http-response-compression.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ Configuring compression for individual HTTP endpoints:
<httpEndpoint id="defaultHttpEndpoint"
httpPort="9080"
httpsPort="9443">
<compression serverPreferredAlgorithm="deflate|gzip|x-gzip|zlib|identity|none">
<types>+application/*</types>
<types>-text/plain</types>
</compression>
<compression/>
</httpEndpoint>
----

Expand All @@ -110,11 +107,22 @@ Configuring compression for all HTTP endpoints:
compressionRef="myCompressionID">
</httpEndpoint>
<compression id="myCompressionID" serverPreferredAlgorithm="deflate|gzip|x-gzip|zlib|identity|none">
<compression id="myCompressionID"/>
----

The `types` attribute in the following example adds all application content types and removes the `text/plain` content type from the `text/*` default.

[source,xml]
----
<httpEndpoint id="defaultHttpEndpoint"
httpPort="9080"
httpsPort="9443">
<compression>
<types>+application/*</types>
<types>-text/plain</types>
</compression>
</compression>
</httpEndpoint>
----
The `types` attribute in the examples adds all application content types and removes the `text/plain` content type from the `text/*` default.


With this new `<compression>` configuration option, you can configure Open Liberty to compress HTTP responses before returning them to clients. This reduces bandwidth and the time taken for HTTP clients to get responses.

0 comments on commit 92df090

Please sign in to comment.