Skip to content

Add response compression and TLS endpoint support#9

Merged
MDA2AV merged 2 commits into
stream-bodiesfrom
add-compression-tls
Jun 4, 2026
Merged

Add response compression and TLS endpoint support#9
MDA2AV merged 2 commits into
stream-bodiesfrom
add-compression-tls

Conversation

@MDA2AV
Copy link
Copy Markdown
Member

@MDA2AV MDA2AV commented Jun 4, 2026

Two engine/module additions, ports of the corresponding GenHTTP features. They unblock the json-comp and json-tls HttpArena profiles for the fishcake entry.

Response compression (Modules/IO)

A Compression concern (gzip via java.util.zip) that negotiates Accept-Encoding and, for compressible content types above a size threshold, replaces the response body with a compressed variant and sets Vary: Accept-Encoding. No third-party dependency. Enable on a host with .add(Compression.default()). Mirrors GenHTTP's Modules/Compression.

  • compression/AcceptEncoding, GzipAlgorithm, CompressedContent, CompressionConcern, CompressionConcernBuilder, + Compression entry point.

TLS endpoints (engine)

HTTPS support in the Netty engine:

  • SecurityConfiguration (PEM certificate chain + PKCS#8 key) on EndPointConfiguration.
  • A secure bind(address, port, certificate, key) overload on the server builder + host.
  • InternalEndPoint builds an SslContext (Netty SslContextBuilder) and prepends an SslHandler so the endpoint terminates TLS and serves HTTP/1.1 over it.

Validation

Exercised end-to-end via the fishcake entry against ./scripts/validate.sh fishcake (compression: Content-Encoding: gzip only with Accept-Encoding; TLS: HTTP/1.1 over TLS serving application/json). All profiles green.

🤖 Generated with Claude Code

MDA2AV and others added 2 commits June 4, 2026 15:52
A `Compression` concern (gzip via java.util.zip) that negotiates Accept-Encoding
and, for compressible content types above a size threshold, replaces the response
body with a compressed variant and sets Vary: Accept-Encoding. Mirrors GenHTTP's
Modules/Compression. Lives under Modules/IO (compression/) with a `Compression`
entry point; enable it on a host via `.add(Compression.default())`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds HTTPS endpoints: a SecurityConfiguration (PEM certificate chain + PKCS#8 key)
on EndPointConfiguration, a secure bind(address, port, certificate, key) overload on
the server builder/host, and an SslHandler prepended to the Netty pipeline (built via
SslContextBuilder) so an endpoint terminates TLS and serves HTTP/1.1 over it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MDA2AV MDA2AV merged commit c3ad712 into stream-bodies Jun 4, 2026
MDA2AV added a commit to MDA2AV/HttpArena that referenced this pull request Jun 4, 2026
* fishcake: add static, json-comp and json-tls profiles

Adds the three remaining isolated HTTP/1.1 profiles to the CodeGreen entry:

- static: serves /data/static with pre-compressed variant selection (serves the
  on-disk .br/.gz sibling with the original file's Content-Type when the client
  accepts it, else the raw file; 404 for a missing file). Implemented in the entry
  (StaticFiles.kt) on CodeGreen's IO primitives.
- json-comp: enables the gzip compression concern on the host (.add(Compression.default()))
  so /json responses carry Content-Encoding: gzip only when Accept-Encoding is sent.
- json-tls: binds HTTPS on :8081 with the harness certificate (/certs), serving HTTP/1.1
  over TLS.

json-comp and json-tls rely on the response-compression module + TLS engine support added
in CodeGreen PR dotnet-web-stack/CodeGreen#9; the Dockerfile temporarily clones that branch
(add-compression-tls) until it merges to stream-bodies.

./scripts/validate.sh fishcake passes 41/0 (12 profiles).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fishcake: clone CodeGreen from main (compression/TLS/pipelining merged)

CodeGreen PRs #9 (response compression + TLS + pipelined flush coalescing) and #10
(request-body streaming) are merged to main, so the build no longer needs the temporary
add-compression-tls branch. Clone main, which carries everything these profiles use.

Validated via the real (clone-from-main) Docker build: ./scripts/validate.sh fishcake = 41/0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Benchmark results: fishcake

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant