Guys I know most of you will say its a bad design and its not possible, but I want to explore the power of HTTP Status codes
I have a client and a server. Theres a loadbalancer in between. For some reason its timeout cannot be increased
. I don't want to modify the client.
I am doing a heavy duty processing on the server that exceeds the loadbalancer's timeout.
I was streaming response to the client. After my heavy job is finished i send the final response to client.
Is it possible to somehow alert the client to discard any streamed data sent before the response. Can i send just the response code again. (Any hack?)
My code
Response :
$ curl -i
http://localhost:8080/stream
HTTP/1.1 207 Multi-Status
Server: Apache-Coyote/1.1
Content-Type: text/html
Transfer-Encoding: chunked
Date: Mon, 25 Jun 2012 18:34:07 GMT
++++++++++My job's output
I expect
$ curl -i
http://localhost:8080/stream
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html
Transfer-Encoding: chunked
Date: Mon, 25 Jun 2012 18:34:07 GMT
My job's output