Simon WillisonProducts

asgi-gzip 0.3

Share
AI-Generated Summary

# Summary: asgi-gzip 0.3 Release

A new version of asgi-gzip has been released to address a critical bug affecting Server-Sent Events (SSE) and text streaming responses. The issue was discovered during production deployment of a new feature on a Datasette instance running datasette-gzip, which depends on asgi-gzip for compression functionality. The middleware was incorrectly compressing event/text-stream responses, causing operational problems in live environments.

The asgi-gzip middleware, originally extracted from the Starlette web framework, is widely used to automatically compress HTTP responses. The bug highlights a gap between the middleware's behavior and the requirements of streaming protocols like SSE, which rely on specific content-type handling and response streaming patterns to function correctly.

This fix is significant for developers using Datasette, datasette-gzip, or asgi-gzip directly, as it ensures streaming responses are handled properly without unwanted compression. The release underscores the importance of thoroughly testing middleware behavior with modern web protocols that depend on streaming and event-based communication patterns.

Key Takeaways

  • 3 Release A new version of asgi-gzip has been released to address a critical bug affecting Server-Sent Events (SSE) and text streaming responses.
  • The issue was discovered during production deployment of a new feature on a Datasette instance running datasette-gzip, which depends on asgi-gzip for compression functionality.
  • The middleware was incorrectly compressing event/text-stream responses, causing operational problems in live environments.
  • The asgi-gzip middleware, originally extracted from the Starlette web framework, is widely used to automatically compress HTTP responses.

Read the full article on Simon Willison

Read on Simon Willison
Share