HowTo: Decrease Page Load Times
Posted by Mike Skinner July 2, 2007
Whilst working on the weekend, I found that the number of simultaneous requests I could make to a web server was limited by my web browser – severely.
I have one Linux server, performing port forwarding for our overseas offices (mostly so they can use Remote Desktop).
I had developed a PHP page to display whether a connection could be opened on each of the forwarded ports. A connection attempt would be tried against each port sequentially, however this caused the page to load very slowly – especially since some requests were making a round trip from the UK to Australia.
On the weekend I upgraded the page to use a very small AJAX library I wrote. Although the page loaded quickly, the statuses returned from each AJAX request were slow.
Although the browser settings I ended up tweaking will not make the aforementioned page load faster (unless all users make these changes), it does make web pages load faster in general.
- Enter into the address bar:
about:config - Then filter on the string:
connections - Change the value of network.http.max-connections to 64
- Change the value of network.http.max-connections-per-server to 32
- Change the value of network.http.max-persistent-connections-per-server to 8
- Create a new text file and save it with a .reg extension.
- Paste into this file the following text:
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings] “MaxConnectionsPerServer”=dword:00000010 “MaxConnectionsPer1_0Server”=dword:0000010
- Save the reg file.
- Double click on it to import the updated settings.
Please note that a logoff or reboot may be required after altering the registry. If you are unsure about modifying your registry, please Google these settings first as I will not be held liable for any adverse consequences for these instructions.
In retrospect, I remember using a Firefox extension called Fasterfox in the past, however I would rather keep my extension list short.
Long ago, Mosaic and Netscape allowed users to configure the maximum number of connections. Here is a screenshot I took for you old timers ;-)
For a standard Apache server (using the prefork model), each persistent connection will need an apache child process.
It’s probably a good thing most clients don’t up these settings :)
This reminds me of an article I read a while back about how to do this from the server side: use multiple subdomains.
http://www.die.net/musings/page_load_time/
The goal was slightly different here, but probably a bit more applicable to our everyday work.
Wow.. apparently I don’t read your blog very often…