Jump to content

The Truth About the Firefox “Pipelining” Trick


Recommended Posts

Posted

source: [url=http://egonitron.com/2007/05/25/the-truth-about-the-firefox-pipelining-trick/]http://egonitron.com/2007/05/25/the-truth-about-the-firefox-pipelining-trick/[/url]
copied and pasted here

If you’re reading this blog, you probably use Firefox (77% of you, according to my analytics) and have possibly heard about the “pipelining” trick to speed up browsing. But does it really work? Yes…yes it does. But let me show you the right way to use it.

pipeliningIf you aren’t familiar with the trick, it claims to speed up your browsing in Firefox by opening up multiple “pipes,” allowing you to make multiple http requests to a web server, each pipe downloading a different part of the web page, then assembling them correctly at your browser.

    Normally, HTTP requests are issued sequentially, with the next request being issued only after the response to the current request has been completely received. Depending on network latencies and bandwidth limitations, this can result in a significant delay before the next request is seen by the server.

    HTTP/1.1 allows multiple HTTP requests to be written out to a socket together without waiting for the corresponding responses. The requestor then waits for the responses to arrive in the order in which they were requested. The act of pipelining the requests can result in a dramatic improvement in page loading times, especially over high latency connections.

The Problem

There’s really nothing wrong with the hack if done correctly. The problem lies in the (mis)communication of how to implement it. Most blogs you read are going to tell you to set the “network.http.pipelining.maxrequests” value to some huge number like 30, so you can make 30 http requests at once (I’ll let you know what that means later in the post, keep reading.) This is why that’s ridiculous:

    * Firefox only has the ability to send 8 requests at once, so altering this value to anything higher than 8 is pointless. Will it hurt anything if you set it that high? No, but it just shows you that the people who told you to do this don’t know what they’re doing.
    * Even if it could send 30 http requests at once, you wouldn’t want to set it that high. If everyone made 30 simultaneous http requests to every web server they connected with, the internet would be slow, webmasters would hate you (and Mozilla,) and your IP would probably be banned from many websites. There is a reason that this setting is turned off by default.
    * The higher you set this value, the more likely it is that you will break something. But don’t fret about it.

That being said, I love this feature, and use it to it’s fullest. I suggest you do the same, if it works well for you.
The correct way to use the Pipelining feature

Note: You must have a (preferably fast) broadband connection. If you have dial-up, stop reading, forget it, pipelining isn’t for you.

Also, if you don’t use Firefox, please download it. You won’t regret it:

In normal Microsoft fashion, Internet Explorer doesn’t support pipelining (even IE7)

  1. Open a new tab in Firefox (Ctrl+T) and type “about:config” (without the quotes) in your address bar.
  2. In the “Filter:” search box, type “network.http” (again, without the quotes.) You don’t have to hit enter.
          * Look for the “network.http.keep-alive” setting and make sure it’s set to “true”. If it’s “false,” double-click that line and it will change to true.
          * On the same page, look for “network.http.version” and make sure it’s set to “1.1″
  3. Now clear out the Filter box and type in “pipelining”
          * Look for “network.http.pipelining” Right-click on that line, and click on “toggle” and be sure the value is set to “true” (or double-click to toggle values.)
          * If you’re on a proxy, look for “network.http.proxy.pipelining” Right-click on that line, and click on “toggle” and be sure the value is set to “true”. If you don’t know if you’re on a proxy or not, just set it to “true” anyway. It won’t hurt anything.
          * Lastly, look for “network.http.pipelining.maxrequests” Right-click on that line, click on “modify” and set the value to 8. You can set it anywhere between 1 and 8. If you notice your internet is acting weird after this, try decreasing this value.
  4. Keep in mind that this may not agree with some web servers, and therefore break the webpage. I have not personally experienced this yet, but this feature is still in testing, and that’s why it’s not set to “true” by default.

There you have it. Ignore the sites telling you to set the value to “30.” Those same pages will also tell you to create a new value called “nglayout.initialpaint.delay” and to set that value to “0″. All this does is start displaying the information on the webpage sooner. nglayout.initialpaint.delay does not make your page load faster. In fact, it can make it load slower; especially on slower connections. If you create this value and set it to “0″ you will notice the page beginning to render right away, but it will take longer to finish completely.
The final word

There are many little hacks in Firefox that you can perform, and I plan on covering many of them in future posts. The Mozilla guys have done a great job in making Firefox fast, and most of the time you will be happy with the default settings. But not all computers are the same, and they can’t predict that. There is a reason that many of these settings are set the way they are by default, and you should only change them if you know what the value actually does. Don’t listen to someone who says “change this random value in about:config, it will make your pages load faster” without explaining to you what the value actually does. That setting may work great for him, but may not work well for you.

Posted

[img]http://egonitron.com/wp-content/uploads/2007/05/pipelining.jpg[/img]

I just tried this using Google image searches. Without pipelining, the pages loaded in an average of about 2.75 seconds. With pipelining, the average was about 2.25 seconds. Subjectively, the delay before the first image loaded seemed about the same, but the delay between the first image loaded and all images were loaded seemed much shorter.

×
×
  • Create New...