Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens when a user presses stop in their web browser?

If a page is called that requires a lot of processing and the user clicks stop before the end, does the browser simply stop the request at the client side?

Or is a 'stop' message sent to the server, i.e. is the processing cancelled?

like image 229
Jon Winstanley Avatar asked Mar 30 '10 09:03

Jon Winstanley


People also ask

How do I stop browser requests?

Right-click on the request. Select one of the options, "Block request URL" or "Block request Domain" - domain option only available in Chrome.

What is a URL request asking for?

An HTTP request is made by a client, to a named host, which is located on a server. The aim of the request is to access a resource on the server. To make the request, the client uses components of a URL (Uniform Resource Locator), which includes the information needed to access the resource.


2 Answers

No message is sent to the server when that happens. When the user presses the stop button, the browser just halts the rendering of the page and ignore any further response= from the server.

If the request has already been sent to the server, the server will usually continue executing it. However, depending on the server's implementation, may detect the dropped connection. Meaning you can not rely on the fact that it will continue in every case.

like image 181
Darin Dimitrov Avatar answered Sep 28 '22 07:09

Darin Dimitrov


Actually it kind of sends a "stop message" by closing the connection. This is true only if it is still waiting for output from the main request (not when finished downloading content and started loading images and stuff). So you can detect if the user presses the stop button OR there is some trouble with the connection, when you get connection closed message.

Here is some info on PHP's user manual: http://php.net/manual/en/features.connection-handling.php

On a side note - it always depend on the browser implementation and there is no certain way to be sure if the user pressed the stop button or the connection just dropped.

like image 22
bisko Avatar answered Sep 28 '22 07:09

bisko