No response from web page
I have a web page where I redirect the user to if I see that IP is not valid. I want that user's browser will get no response but kept into waiting state, but I also want that my server thread is not blocked for that request. So the idea wa开发者_JS百科s that server will response quickly but the user' browser will put into waiting loop to discourage the user. How can I achieve this easily? Is it possible without JavaScript? If JavaScript is the only way then suggest that solution.
Thanks
The problem here is that HTTP is a request/response protocol. If you are redirecting the user, you're responding to that original request. Unless the user generates another request (via javascript or whatever) then the server can't respond again.
You don't need to put the browser into a 'waiting state', if the server simply doesn't reply to the request the browser will just keep on waiting.
I think you're trying to say that your IP task takes a long time, and how to deal with that effectively?
Perhaps if you clear up your question I can answer more fully.
No this is not possible. The problem is to keep the browser waiting with no response you need to keep the connection open and not write to it. The result of this will be:
- It will cause your server to run out of connections and use memory to maintain connections
- The client will timeout, even if you do not reply
You could purhaps reply with a page that contained a java script with an infinate loop.
精彩评论