From 0fd006d7a78a0d017e7abc81d0208868d6b73518 Mon Sep 17 00:00:00 2001 From: Georgiy Tarasov Date: Wed, 30 Oct 2024 17:39:20 +0100 Subject: [PATCH] chore: use header to disable nginx buffering --- posthog/api/query.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/posthog/api/query.py b/posthog/api/query.py index beb1415b8dc38..00d4548eeae37 100644 --- a/posthog/api/query.py +++ b/posthog/api/query.py @@ -206,7 +206,9 @@ def generate(): {"prompt": human_message.content, "response": last_message}, ) - return StreamingHttpResponse(generate(), content_type=ServerSentEventRenderer.media_type) + return StreamingHttpResponse( + generate(), content_type=ServerSentEventRenderer.media_type, headers={"X-Accel-Buffering": "no"} + ) def handle_column_ch_error(self, error): if getattr(error, "message", None):