1

We have different development severs and a production server. Testing is done in the development servers. As a QA engineer, I'm switching between these servers quite often throughout the day.

In Chrome, sometimes I need to reload a page a few times to get it to pull from the newly switched server.

In Firefox, sometimes I need to quit the browser in order to get it to pull from the newly switched server.

(We have small tags that indicate which server you are pulling from, which is how I know in-browser.)

Why does that happen? I'd love to know how that happens (maybe what it's called?) and what the best way to deal with it is. (I know that Firefox has an extension for domain switching; is that the best solution?)

boo-urns
  • 561
  • 2
  • 9
  • 22
  • This happens because Firefox keeps the socket open (you can see this with `netstat`). Once the socket is closed it will connect to the new one. I don't know of a way to force firefox to close the socket except by quitting. – bahamat Mar 09 '11 at 23:56
  • I think this is a valid answer. You should move this to that section to get some reputation! – boo-urns Mar 10 '11 at 19:18
  • @Jeremy I'll take it ;-) – bahamat Mar 10 '11 at 20:03
  • How do you switch between these servers? Do they have different domain names, IP addresses, ...? – Arjan Mar 10 '11 at 20:14
  • @Arjan They have different IP addresses, but the same domain name. So I'll change my hosts file to reflect the new IP address for the same domain. Does that make sense? We're not sure that that's the best way to switch environments, but that's what we have implemented atm. If you have a better way of doing it, please share! I'd love some feedback. – boo-urns Mar 10 '11 at 23:37
  • Why would you need the same domain name? – Arjan Mar 11 '11 at 00:26
  • Anyway: you could use a rewriting proxy (like [GlimmerBlocker](http://glimmerblocker.org/) on a Mac or [Fiddler](http://www.fiddlertool.com/) on Windows) to rewrite the request. You can then use specific names in your browser's location bar (and hence the HOSTS file) and rewrite those to become the very same `Host` header in the HTTP request. (See also [Browser with its own hosts file?](http://superuser.com/questions/221706/browser-with-its-own-hosts-file)) Not as easy as different domain names, but it at least ensures the browser does not mix test and production cookies and credentials... – Arjan Mar 11 '11 at 01:02

1 Answers1

2

This happens because Firefox keeps the socket open (you can see this with netstat). Once the socket is closed it will connect to the new one. I don't know of a way to force firefox to close the socket except by quitting.

bahamat
  • 5,646
  • 1
  • 26
  • 26