Skip to content

docs: document ENABLE_COMPRESSION_MIDDLEWARE trade-offs across perf a…#1324

Merged
Classic298 merged 2 commits into
open-webui:devfrom
Classic298:claude/compression-middleware-perf-docs-dgj98w
Jul 20, 2026
Merged

docs: document ENABLE_COMPRESSION_MIDDLEWARE trade-offs across perf a…#1324
Classic298 merged 2 commits into
open-webui:devfrom
Classic298:claude/compression-middleware-perf-docs-dgj98w

Conversation

@Classic298

Copy link
Copy Markdown
Member

…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

claude added 2 commits July 20, 2026 13:14
…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
@Classic298
Classic298 merged commit ae274f7 into open-webui:dev Jul 20, 2026
1 check failed
@Classic298
Classic298 deleted the claude/compression-middleware-perf-docs-dgj98w branch July 20, 2026 13:23
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.

2 participants