1. Skip the compressor for clients that offer no encoding
Listing p50 at one user was 3.25 ms on main against 1.95 on the previous
release; a bisect put all of it on #288. Not gzip — the harness never sent Accept-Encoding. Hono's middleware inspects every compressible response it
declines and sets Vary, which rebuilds a streamed passthrough off its fast
path: ~1.2 ms per JMAP call for a request that asked for nothing.
one user
Accept-Encoding
list p50
compressor touches but declines (before)
none
3.25 ms
skipped entirely (fix)
none
2.02 ms
compressor applied
gzip
2.27 ms
previous release
either
1.95 ms
Applying gzip to a JMAP response costs about a quarter of a millisecond for
3–5× fewer bytes, so JMAP stays compressed by default; COMPRESS_JMAP=0
turns it off.
2. Push by subscription: hold no upstream connection per tab
RFC 8620 §7.2 PushSubscription, one per account, registered at sign-in;
Stalwart POSTs StateChange to /api/push/<token> and ihasmail fans it out
to that account's tabs over the browser streams it already holds. A tab opens
on the relay and migrates to fan-out when its account verifies — upstream
request ended, browser stream untouched, nothing retained. Clean-room from
the RFC.
Measured at 256 MiB over a private route, 6,144 accounts verified during the
ramp, zero failures, zero errors:
tabs
client
Stalwart
system KiB/tab
raw relay (before)
5,000
48.2
46.4
94.6
push by subscription
6,144
33.3
4.8
38.0
Bulwark 1.9.2, same bench
12,389
4.8
53.8
58.6
One descriptor per tab. Stalwart holds no connection for ihasmail's users, so
its per-listener limit no longer applies to ihasmail. System-wide, 35% less
per tab than Bulwark, with the mail server still private.
Deployment requirement:PUSH_URL is the https origin Stalwart reaches
ihasmail at; the RFC requires https and Stalwart enforces it, so Stalwart
must trust that certificate (a public TLS front already does; a private
segment needs an internal CA in Stalwart's trust store). An account that
cannot verify stays on the relay — nothing breaks, only the saving needs the
cert. PUSH_MODE=relay disables the path. /api/health reports the split.
Proven on the committed HEAD: verified ≤10 s after sign-in, tab opened
directly onto fan-out, StateChange delivered. 159 tests. No user-visible
strings, so no catalogue work.
Two commits, review separately.
### 1. Skip the compressor for clients that offer no encoding
Listing p50 at one user was 3.25 ms on `main` against 1.95 on the previous
release; a bisect put all of it on #288. Not gzip — the harness never sent
`Accept-Encoding`. Hono's middleware inspects every compressible response it
declines and sets `Vary`, which rebuilds a streamed passthrough off its fast
path: ~1.2 ms per JMAP call for a request that asked for nothing.
| one user | `Accept-Encoding` | list p50 |
| --- | --- | --- |
| compressor touches but declines (before) | none | 3.25 ms |
| **skipped entirely (fix)** | none | **2.02 ms** |
| compressor applied | gzip | 2.27 ms |
| previous release | either | 1.95 ms |
Applying gzip to a JMAP response costs about a quarter of a millisecond for
3–5× fewer bytes, so JMAP stays compressed by default; `COMPRESS_JMAP=0`
turns it off.
### 2. Push by subscription: hold no upstream connection per tab
RFC 8620 §7.2 `PushSubscription`, one per account, registered at sign-in;
Stalwart POSTs `StateChange` to `/api/push/<token>` and ihasmail fans it out
to that account's tabs over the browser streams it already holds. A tab opens
on the relay and migrates to fan-out when its account verifies — upstream
request ended, browser stream untouched, nothing retained. Clean-room from
the RFC.
Measured at 256 MiB over a private route, 6,144 accounts verified during the
ramp, zero failures, zero errors:
| | tabs | client | **Stalwart** | **system** KiB/tab |
| --- | --- | --- | --- | --- |
| raw relay (before) | 5,000 | 48.2 | 46.4 | 94.6 |
| **push by subscription** | **6,144** | 33.3 | **4.8** | **38.0** |
| Bulwark 1.9.2, same bench | 12,389 | 4.8 | 53.8 | 58.6 |
One descriptor per tab. Stalwart holds no connection for ihasmail's users, so
its per-listener limit no longer applies to ihasmail. System-wide, 35% less
per tab than Bulwark, with the mail server still private.
**Deployment requirement:** `PUSH_URL` is the https origin Stalwart reaches
ihasmail at; the RFC requires https and Stalwart enforces it, so Stalwart
must trust that certificate (a public TLS front already does; a private
segment needs an internal CA in Stalwart's trust store). An account that
cannot verify stays on the relay — nothing breaks, only the saving needs the
cert. `PUSH_MODE=relay` disables the path. `/api/health` reports the split.
Proven on the committed HEAD: verified ≤10 s after sign-in, tab opened
directly onto fan-out, `StateChange` delivered. 159 tests. No user-visible
strings, so no catalogue work.
**Merged** 2026-09-06 as coffey-labs/ihasmail@db7b103a08d5
<sub>Rebuilt from: GH Archive, git history, session transcript.</sub>
This repo is archived. You cannot comment on issues.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Two commits, review separately.
1. Skip the compressor for clients that offer no encoding
Listing p50 at one user was 3.25 ms on
mainagainst 1.95 on the previousrelease; a bisect put all of it on #288. Not gzip — the harness never sent
Accept-Encoding. Hono's middleware inspects every compressible response itdeclines and sets
Vary, which rebuilds a streamed passthrough off its fastpath: ~1.2 ms per JMAP call for a request that asked for nothing.
Accept-EncodingApplying gzip to a JMAP response costs about a quarter of a millisecond for
3–5× fewer bytes, so JMAP stays compressed by default;
COMPRESS_JMAP=0turns it off.
2. Push by subscription: hold no upstream connection per tab
RFC 8620 §7.2
PushSubscription, one per account, registered at sign-in;Stalwart POSTs
StateChangeto/api/push/<token>and ihasmail fans it outto that account's tabs over the browser streams it already holds. A tab opens
on the relay and migrates to fan-out when its account verifies — upstream
request ended, browser stream untouched, nothing retained. Clean-room from
the RFC.
Measured at 256 MiB over a private route, 6,144 accounts verified during the
ramp, zero failures, zero errors:
One descriptor per tab. Stalwart holds no connection for ihasmail's users, so
its per-listener limit no longer applies to ihasmail. System-wide, 35% less
per tab than Bulwark, with the mail server still private.
Deployment requirement:
PUSH_URLis the https origin Stalwart reachesihasmail at; the RFC requires https and Stalwart enforces it, so Stalwart
must trust that certificate (a public TLS front already does; a private
segment needs an internal CA in Stalwart's trust store). An account that
cannot verify stays on the relay — nothing breaks, only the saving needs the
cert.
PUSH_MODE=relaydisables the path./api/healthreports the split.Proven on the committed HEAD: verified ≤10 s after sign-in, tab opened
directly onto fan-out,
StateChangedelivered. 159 tests. No user-visiblestrings, so no catalogue work.
Merged 2026-09-06 as coffey-labs/ihasmail@db7b103a08
Rebuilt from: GH Archive, git history, session transcript.