Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Streaming responses back with FastAPI and API Gateway

Hi!

I have a backend service with FastAPI from which I am streaming back responses with StreamingResponse. I am serving this service from Cloud Run  and through an API Gateway back to the frontend. I have found it impossible to stream back a response because it gets buffered. Moreover, when I try to implement a SSE endpoint, it just times out. Does anyone know how to fix this?

 

Cheers!

0 2 675