HTTP Streaming Through App Proxy Not Working

Highlighted
New Member
1 0 0

I have an app proxy setup so that requests to mystorename.myshopify.com/apps/proxyName/myApplication are directed to my server.  That part is working but I want to stream the http response so that the client gets data as soon as its available, keeps the http connection open, and then streams in more data later as it becomes available.  This is working when I go to my site directly, not through the shopify proxy, but when I go through the shopify proxy the client gets a response only after the shopify proxy gets a full response, not a partial one.

My url is actually also a proxy, specifically an nginx proxy wrapping around an nodejs express server, and I was seeing the same behavior on my proxy until I added this line to my nginx.conf

proxy_buffering off;

 

So it would seem that the shopify proxy is buffering the response, is there a good reason for this?  Wouldn't you want the client to get the data as soon as it becomes available?  Would you be willing to turn off proxy buffering for your proxy?  I know there are other ways to get the "lazy-loading" like behavior that I want, like via ajax, etc. but I think http streaming is the cleanest and most performant way so I would like to use it.

Thanks.

0 Likes