docs: document ENABLE_COMPRESSION_MIDDLEWARE trade-offs across perf a…#1324
Merged
Classic298 merged 2 commits intoJul 20, 2026
Merged
Conversation
…nd scaling guides Verified against open-webui source (env.py / main.py, starlette-compress 1.7.1): the flag only gates CompressMiddleware, which touches HTTP responses exclusively — WebSocket scope passes through untouched, SSE (text/event-stream) is not in the compressible content-type list, and responses under 500 bytes are never compressed. - Expand the env-configuration reference entry with what the middleware does and does not affect, the CPU/latency upside of disabling (~3-4% per worker per py-spy profiling), the response-size downside (few KB for typical API responses, but multi-MB first page load and 5-10x on large chat/model JSON), and the recommended proxy-offload setup - Add an HTTP Response Compression section to the performance guide's High-Concurrency chapter, plus Profile 3 checklist and env var table entries - Add an "Offload HTTP Compression to the Load Balancer" step-3 section and env-block entry to the scaling guide - Add a compress-at-the-LB best practice to the Scaling & HA troubleshooting guide Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XrkxR1KPMABxNNR3b1xr9R
…ssion When ENABLE_COMPRESSION_MIDDLEWARE is disabled in favor of proxy-level compression, the remaining downside (larger first uncached page load) is eliminated by caching the frontend bundles at the proxy: Open WebUI's SvelteKit build ships all JS/CSS under /_app/immutable/ with content-hashed filenames, so a URL never changes content and the files can be cached with max-age=31536000, immutable and served from the proxy cache without touching a worker. - Scaling guide: new "Pair It with Static Asset Caching at the Proxy" subsection with a ready-made Nginx proxy_cache snippet, the HTML-shell/version.json short-cache caveat (upgrade detection), and on-the-fly compression level guidance (level 4-5, min_length) - Performance guide: "Recommended companion" bullet in the HTTP Response Compression section pointing at the scaling snippet - Env reference: extend the compress-at-the-proxy tip with the /_app/immutable/ caching recommendation - Scaling & HA troubleshooting: mention proxy-side bundle caching in the compress-at-the-LB best practice Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XrkxR1KPMABxNNR3b1xr9R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…nd scaling guides
Verified against open-webui source (env.py / main.py, starlette-compress
1.7.1): the flag only gates CompressMiddleware, which touches HTTP
responses exclusively — WebSocket scope passes through untouched, SSE
(text/event-stream) is not in the compressible content-type list, and
responses under 500 bytes are never compressed.
does and does not affect, the CPU/latency upside of disabling (~3-4%
per worker per py-spy profiling), the response-size downside (few KB
for typical API responses, but multi-MB first page load and 5-10x on
large chat/model JSON), and the recommended proxy-offload setup
High-Concurrency chapter, plus Profile 3 checklist and env var table
entries
and env-block entry to the scaling guide
troubleshooting guide