Performance Best Practices

From Hostek.com Wiki
Jump to: navigation, search

Overview

Minimize Requests

Displaying your website in visitors' browsers requires a number of assets in addition to your page content. Whether those assets be images, style sheets, scripts, fonts, or the like, each file or asset requires a separate connection to the web server. This not only creates strain on the server, but also requires your visitors' browser to take longer to fetch each item from the server. The fewer of these resources that your browser requires to download the faster the server can process the requests and the faster the page will load for your visitors.

Concurrent Downloads

Understanding how browsers handles downloading of a page and its assets will also help you avoid performance bottlenecks. When a request is made, the browser actually opens several connections to the web server and downloads files concurrently (simultaneously) as needed. However, all modern browsers have a limit to the maximum number of connections it can make to a web server at any one time. When the browser has reached this limit, it must wait until another connection completes before creating another. If your page consists of numerous files, each of which requires a single connection, this can significantly slow load times for your site.

Concurrent Connections
Browser # Connections
Internet Explorer 6 and 7 2
Internet Explorer 8 6
Internet Explorer 9 6
Internet Explorer 10 8
Firefox 2 2
Firefox 3 6
Firefox 4+ 6
Opera 9 4
Opera 10 8
Opera 11 and 12 6
Chrome 1 and 2 6
Chrome 3 4
Chrome 4+ 6
Safari 3+ 4