mandag, september 12, 2011

Overview of browser concurrent connection limits

Browser concurrent connection limits can be a real performance bottleneck if a web site has many files that need to be downloaded. Remember that even if the files are cached in a browser the browser still contacts the server for each an every file to see if the file has changed since the cached version.

2 kommentarer:

  1. Note that you can prevent the roundtrip to the server for cached files - for example image, js, css assets, by using far-out Expires header. By doing so the browser will serve the files directly from cache (granted the HTML was not served with such header). Just "tag" (name) the requested file with version number (e.g. svn/git rev) on every release in order to force download of fresh content.

    Also; a nice trick to get even more out of the limited number of connections per server, is to split the requests up across different hosts - e.g. img1.mydomain.com, img2.mydomain.com, etc. That means more DNS look-ups, though, so there might not be too much to gain performance wise (dep. on site).

    SvarSlett
  2. Adding a Expire HTTP header seems like a good idea then. In my expierience a DNS lookups usually takes about 15-30 ms, but this may of course if the client has a fast/slow DNS server.

    Turnging off Expect HTTP 100-Continue and/or turning off Nagling if your HTTP POST message body is less than 1.5 KB also improves concurrent connections as the client is connected to the web server for a shorter period of time.

    SvarSlett