fix(statuspages): encode a page once for all servers, gzipped
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 11m55s
ci / test (pull_request) Successful in 13m30s
ci / build (pull_request) Successful in 19m20s
ci / image (pull_request) Successful in 5m37s

Every status page server asking for a page got it encoded anew: the
snapshot was marshalled once for its checksum and again for the answer,
then copied into a stream frame. A page of several thousand components
is about 20 MB of JSON, so servers fetching it together, as they do when
told it changed, ran both API pods out of their 512 MiB.

The shared build now also encodes the page once, as JSON and gzipped,
and every server asking at the same time gets those bytes. Servers ask
for gzip and unpack it, over HTTP and the stream; older ones still get
plain JSON. A 20 MB page shrinks to about 1 MB. Uptime ratios in the
snapshot are rounded to six decimals instead of up to 18 characters,
never to 100% for a component that failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-29 21:58:14 +01:00
1 parent 3bc927a5f7
commit 9424824416
6 files changed
+182 -22

No files matched your search

+4
View File
@@ -38,6 +38,10 @@ func Compress() gin.HandlerFunc {
}
}
// AcceptsGzip reports whether an Accept-Encoding header allows gzip, for
// handlers that send content compressed ahead of time.
func AcceptsGzip(header string) bool { return acceptsGzip(header) }
// acceptsGzip reports whether an Accept-Encoding header allows gzip.
func acceptsGzip(header string) bool {
for _, part := range strings.Split(header, ",") {