Skip to content
Snippets Groups Projects
Unverified Commit 448004a0 authored by Cam Saul's avatar Cam Saul
Browse files

Set X-Accel-Buffering header in streaming resp so nginx doesn't buffer...

Set X-Accel-Buffering header in streaming resp so nginx doesn't buffer :speaking_head:
parent bc1e9611
No related branches found
No related tags found
No related merge requests found
......@@ -189,5 +189,9 @@
(extend-protocol Sendable
ManyToManyChannel
(send* [input-chan _ respond _]
(respond (assoc (response/response input-chan)
:content-type "applicaton/json; charset=utf-8"))))
(respond (-> (response/response input-chan)
(assoc :content-type "applicaton/json; charset=utf-8")
;; tell nginx not to batch streaming responses -- otherwise the keepalive bytes aren't written and
;; the entire purpose is defeated. See
;; https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache
(assoc-in [:headers "X-Accel-Buffering"] "no")))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment