In terms of efficiency which is better: maintaining one single long connection with server, or sending multiple instant requests?
I have a web application with multiple interfaces. On one, when user submits data on a web page, it gets sent to the server by ajax query asap, but server cannot send the required answer for some 3-5 seconds. I have 2 ways: the first is to keep querying the server for answer every second; the second is to make server side keep connection alive until it can answer.
Which way is more efficient for the server and which for the client? The design should allow large number of users.