Submit action -> delay on server -> return


#1

Hi Kevin

I have this idea. I have a form with a submit button. The client submits and the server receives and executes the script since <form action="execute-server.php"..."

Is it possible for the server not to return right away but it could wait… say 5 minutes? I know the connection will time out on the client side. What would be the proper way to do something like this? So to be clear, after 5 minutes the server delivers the page: Hello World. Could this be done via http? I have a feeling this protocol would not allow me to do that… reminds me of the API message discussions we had before.

Kf


#2

Look into long polling which is pretty much exactly what it sounds like: instead of returning immediately, the server can take a long time to come back with a response.

If you need something fancier, then you’re looking at something like websockets. Here’s a link with a lot of good info: