{"html_url": "https://github.com/simonw/datasette/issues/1213#issuecomment-771968675", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1213", "id": 771968675, "node_id": "MDEyOklzc3VlQ29tbWVudDc3MTk2ODY3NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-02T20:41:55Z", "updated_at": "2021-02-02T20:41:55Z", "author_association": "OWNER", "body": "So maybe I could a special response header which ASGI middleware can pick up that means \"Don't attempt to gzip this, just stream it through\".", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 799663959, "label": "gzip support for HTML (and JSON) responses"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1213#issuecomment-771968177", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1213", "id": 771968177, "node_id": "MDEyOklzc3VlQ29tbWVudDc3MTk2ODE3Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-02T20:41:13Z", "updated_at": "2021-02-02T20:41:13Z", "author_association": "OWNER", "body": "Starlette accumulates the full response body in a `body` variable and then does this:\r\n```python\r\n elif message_type == \"http.response.body\":\r\n # Remaining body in streaming GZip response.\r\n body = message.get(\"body\", b\"\")\r\n more_body = message.get(\"more_body\", False)\r\n\r\n self.gzip_file.write(body)\r\n if not more_body:\r\n self.gzip_file.close()\r\n\r\n message[\"body\"] = self.gzip_buffer.getvalue()\r\n self.gzip_buffer.seek(0)\r\n self.gzip_buffer.truncate()\r\n\r\n await self.send(message)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 799663959, "label": "gzip support for HTML (and JSON) responses"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1213#issuecomment-771965281", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1213", "id": 771965281, "node_id": "MDEyOklzc3VlQ29tbWVudDc3MTk2NTI4MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-02T20:37:08Z", "updated_at": "2021-02-02T20:39:24Z", "author_association": "OWNER", "body": "Starlette's gzip middleware implementation is here: https://github.com/encode/starlette/blob/0.14.2/starlette/middleware/gzip.py", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 799663959, "label": "gzip support for HTML (and JSON) responses"}, "performed_via_github_app": null}