{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/7"},{"label":"Dynamic Content","url":"https://skillfed.io/packages/category/internet-www-http-dynamic-content"},{"label":"Middleware","url":"https://skillfed.io/packages/category/internet-www-http-wsgi-middleware"}],"enrichment":{"capability":"Middleware for Starlette and FastAPI that compresses HTTP responses using ZStd, Brotli, or GZip, with sensible defaults and more algorithm options than Starlette's built-in GZipMiddleware.","skillfed_tags":["middleware","compression","asgi"],"use_cases":["Reduce bandwidth on Starlette or FastAPI APIs by automatically compressing JSON, HTML, and text responses","Add ZStd or Brotli compression to applications that only have GZip available in Starlette's built-in middleware","Compress Server-Sent Events (SSE) streams with per-message flushing to maintain real-time delivery","Tune compression levels per algorithm to balance file size reduction against CPU cost for specific workloads","Manage compression for custom content types or opt out of compression for specific response types"],"what_it_does":"starlette-compress is a middleware layer for Starlette and FastAPI applications that automatically compresses HTTP responses using one of three algorithms: ZStd, Brotli, or GZip. It sits between your application and the client, intercepting responses and reducing their size before transmission. The middleware applies sensible defaults\u2014compressing responses 500 bytes or larger, using compression level 4 for all algorithms\u2014while remaining configurable for different minimum sizes, compression levels, and content types.\n\nThe package handles both standard request-response flows and streaming scenarios like Server-Sent Events (SSE), where it flushes the compressor after each message to maintain low latency. It works with asyncio and trio backends, supports modern Python versions (3.9 through 3.14), and requires four runtime dependencies: starlette itself, plus brotli, brotlicffi, and zstandard for the respective compression algorithms.","worth_installing":"Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive license, and offers a straightforward drop-in middleware for Starlette/FastAPI with more compression options and better defaults than the built-in alternative. Low install friction and broad Python version support make it a practical choice for any Starlette or FastAPI project needing response compression."},"id":"starlette-compress","links":{"html":"https://skillfed.io/packages/starlette-compress","md":"https://skillfed.io/packages/starlette-compress.md","pypi":"https://pypi.org/project/starlette-compress/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-07-18","license_spdx":"0BSD","license_treatment":"permissive","name":"starlette-compress","python_support":"supports_current","summary":"Compression middleware for Starlette - supporting ZStd, Brotli, and GZip"},"popularity":{"monthly_downloads":1114521,"position":4351,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.8.0"}
