Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify and differentiate examples #4056

Merged
merged 5 commits into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.