I have an application in RubyOnRails, proxied by a NGINX server that is behind a CDN service. The CDN has a limitation that if the response first byte does not arrive in 60 seconds, the CDN server responds:
Error 503 first byte timeout
The problem is that I do have some requests that take more than 60 seconds to be processed on the Rails side. Is there a way to hack the response, sending a few bytes before the response finish its processing? How?
I know 60s is a long time and we are thinking about ways to avoid this. Still, I need a temporary solution that allows those 60s requests work. Even if I use Ajax, some ajax calls would take more than 60s and would fall into the same issue. The tcp_nopush or tcp_nodelay options did not work, I think it is because nginx is waiting the rails application response to know what headers it should send. So, maybe the solution is something that I need to hack inside the RubyOnRails request/response cycle