Treat HTTP connections to same server independently.

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Post Reply
juanps90
Posts: 4
Joined: March 17th, 2015, 11:32 am

Treat HTTP connections to same server independently.

Post by juanps90 »

I have a web app that, in some cases, takes a few seconds until the response is completed. During this time, any other http requests to the same server (i.e another tab) seem to wait until the already running request is completed. This is a problem since users keep several tabs active during sessions and every one of them become unresponsive because of this behavior.

This appears to be a Firefox limitation and not server related (ie the server is not under heavy load) since this problem can be worked around by accessing the resources by using different host names and/or IPs.

I tweaked network.http.max-connections-per-server with no results.

Is there some sort of setting or addon that I can install on each of the clients to enable connections to the same server to be treated independently?

Thanks a lot !
User avatar
trolly
Moderator
Posts: 39851
Joined: August 22nd, 2005, 7:25 am

Re: Treat HTTP connections to same server independently.

Post by trolly »

To test if this is really a firefox issue please use multiple firefox instances to see if the problem vanishes.
Either use portable firefox or see here
http://kb.mozillazine.org/Opening_a_new ... er_profile
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.
juanps90
Posts: 4
Joined: March 17th, 2015, 11:32 am

Re: Treat HTTP connections to same server independently.

Post by juanps90 »

Using two different hostnames: works.
Using one normal tab and one private tab: works.
Using two tabs with the same hostname: does not work.
Using Firefox and Chromium: works.

Basically the only thing that does not work is having two tabs pointing to the same hostname on the same firefox window.

I have been struggling with this issue since like months ago but I can't find a way to word it to get satisfactory results on search engines.
User avatar
trolly
Moderator
Posts: 39851
Joined: August 22nd, 2005, 7:25 am

Re: Treat HTTP connections to same server independently.

Post by trolly »

Moving to "Web Development" for other ideas ...
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.
Dom1953
Posts: 52
Joined: July 24th, 2014, 6:02 am
Location: Australia

Re: Treat HTTP connections to same server independently.

Post by Dom1953 »

Have you tried increasing Firefox's maximum number of persistent connections per server ("network.http.max-persistent-connections-per-server" in about:config) as alluded to in https://support.mozilla.org/en-US/questions/985646?
juanps90
Posts: 4
Joined: March 17th, 2015, 11:32 am

Re: Treat HTTP connections to same server independently.

Post by juanps90 »

Doubled it (from 20 to 40) and no effect. I am pretty sure that Firefox recognizes the server as being slow and therefore decides to wait until the other request is completed.

The number of persistent connections does sound like the right setting to tweak but it apparently has no effect on the end result, so I am still stuck with this issue.

Web Development? Srsly? :p
User avatar
trolly
Moderator
Posts: 39851
Joined: August 22nd, 2005, 7:25 am

Re: Treat HTTP connections to same server independently.

Post by trolly »

Yes. I said "for other ideas" which means that I hope other people had this problem too and that they found a fix for it.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.
juanps90
Posts: 4
Joined: March 17th, 2015, 11:32 am

Re: Treat HTTP connections to same server independently.

Post by juanps90 »

Are there any http flags (sent by php script) that I can set to make Firefox work differently?

By the way, I should've said it earlier but... My clients are running Firefox on Ubuntu, some of them manually installed via the tar.gz on the Mozilla website, some others via APT.

This behavior seems to be consistent across several Firefox versions
User avatar
trolly
Moderator
Posts: 39851
Joined: August 22nd, 2005, 7:25 am

Re: Treat HTTP connections to same server independently.

Post by trolly »

This is purely guessing but it is possible that JS requests are queued by domain name which would explain the problem nicely. But you already assume something like that.
To be sure: This is not a cross domain request?

Are you able to catch the traffic using Wireshark? Then you will see if the requests are queued or not.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.
User avatar
jscher2000
Posts: 11759
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: Treat HTTP connections to same server independently.

Post by jscher2000 »

I looked into a similar report last October and came to the conclusion that if Firefox has an open request for a URL, it does not re-request the identical URL for a new tab until the first request has completed. The only workaround that came to mind was to vary the query string.

For discussion, test URLs, etc., see: https://support.mozilla.org/questions/9 ... wer-639135
Post Reply