# Forcing a browser to open a new connection

**URL:** <https://www.ruby-forum.com/t/forcing-a-browser-to-open-a-new-connection/117531>\
**Category:** NGINX\
**Created:** [October 17, 2007, 8:35pm UTC](https://www.ruby-forum.com/t/forcing-a-browser-to-open-a-new-connection/117531 "2007-10-17T20:35:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manlio\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@Manlio\_P](https://www.ruby-forum.com/u/Manlio_P)\
**Post date:** [October 17, 2007, 8:35pm UTC](https://www.ruby-forum.com/t/forcing-a-browser-to-open-a-new-connection/117531/1 "2007-10-17T20:35:02Z")

</div>

What is the best method for forcing a browser to close the current  
connection and to open a new connection?

Now I’m using the Refresh headers.

Thanks Manlio P.

---

<div class="post-metadata">

**Author:** ![Manlio\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@Manlio\_P](https://www.ruby-forum.com/u/Manlio_P)\
**Post date:** [October 17, 2007, 8:47pm UTC](https://www.ruby-forum.com/t/forcing-a-browser-to-open-a-new-connection/117531/2 "2007-10-17T20:47:22Z")

</div>

On Wed, Oct 17, 2007 at 08:23:41PM +0200, Manlio P. wrote:

> What is the best method for forcing a browser to close the current  
> connection and to open a new connection?
> 
> Now I’m using the Refresh headers.

r-\>keepalive = 0;

---

<div class="post-metadata">

**Author:** ![Manlio\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@Manlio\_P](https://www.ruby-forum.com/u/Manlio_P)\
**Post date:** [October 17, 2007, 8:58pm UTC](https://www.ruby-forum.com/t/forcing-a-browser-to-open-a-new-connection/117531/3 "2007-10-17T20:58:29Z")

</div>

Igor S. ha scritto:

> On Wed, Oct 17, 2007 at 08:23:41PM +0200, Manlio P. wrote:
> 
> > What is the best method for forcing a browser to close the current  
> > connection and to open a new connection?
> > 
> > Now I’m using the Refresh headers.
> 
> r-\>keepalive = 0;

Here is, in detail, what I want to do (again, for mod\_python).

1. A browser requests a resource (WSGI application)
2. mod\_python detects that the Python script has changed,  
and (if enabled) raises the SIGQUIT signal, so that a new process  
can  
be created, that will load the updated WSGI application
3. I need to tell the brower to make a new request, so that it will use  
the updated script

Thanks Manlio P.

---

<div class="post-metadata">

**Author:** ![Manlio\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@Manlio\_P](https://www.ruby-forum.com/u/Manlio_P)\
**Post date:** [October 17, 2007, 10:58pm UTC](https://www.ruby-forum.com/t/forcing-a-browser-to-open-a-new-connection/117531/4 "2007-10-17T22:58:39Z")

</div>

Igor S. ha scritto:

> > >

Ok, thanks.  
I have tried to return 503 Service Unavailable, with a Retry-After: 0  
header, but Firefox does not support this.

Another solution is to use the Location header with a 3xx response.

Regards Manlio P.

---

<div class="post-metadata">

**Author:** ![Manlio\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@Manlio\_P](https://www.ruby-forum.com/u/Manlio_P)\
**Post date:** [October 17, 2007, 9:04pm UTC](https://www.ruby-forum.com/t/forcing-a-browser-to-open-a-new-connection/117531/5 "2007-10-17T21:04:57Z")

</div>

On Wed, Oct 17, 2007 at 08:49:30PM +0200, Manlio P. wrote:

> Here is, in detail, what I want to do (again, for mod\_python).
> 
> 1. A browser requests a resource (WSGI application)
> 2. mod\_python detects that the Python script has changed,  
> and (if enabled) raises the SIGQUIT signal, so that a new process can  
> be created, that will load the updated WSGI application
> 3. I need to tell the brower to make a new request, so that it will use  
> the updated script

Refresh is no standard way, but as I know it is supported by all  
browsers.
