flash service

High_Performance_Web_Sites

Issue link: https://read.uberflip.com/i/1146286

Contents of this Issue

Navigation

Page 89 of 169

68 | Chapter 9: Rule 9: Reduce DNS Lookups Fasterfox (http://fasterfox.mozdev.org) is a well-known Firefox add-on for measuring and improving Firefox performance. As a point of comparison, Fasterfox changes these DNS settings to have the following values: • network.dnsCacheExpiration: 1 hour • network.dnsCacheEntries: 512 • network.http.keep-alive.timeout: 30 seconds Reducing DNS Lookups When the client's DNS cache is empty (for both the browser and the operating sys- tem), the number of DNS lookups is equal to the number of unique hostnames in the web page. This includes the hostnames used in the page's URL, images, script files, stylesheets, Flash objects, etc. Reducing the number of unique hostnames reduces the number of DNS lookups. Google (http://www.google.com) is the preeminent example of this, with only one DNS lookup necessary for the page. Reducing the number of unique hostnames has the potential to reduce the amount of parallel downloading that takes place in the page. Avoiding DNS lookups cuts response times, but reducing parallel downloads may increase response times. As described in Chapter 6 in the section "Parallel Downloads," some amount of parallel- ization is good, even if it increases the number of hostnames. In the case of Google. com, there are only two components in the page. Because components are down- loaded two per hostname in parallel, using one hostname minimizes the number of possible DNS lookups while maximizing parallel downloads. Most pages today have a dozen or more components—not nearly as lean as Google. My guideline is to split these components across at least two but no more than four hostnames. This results in a good compromise between reducing DNS lookups and allowing a high degree of parallel downloads. The advantage of using Keep-Alive, described in Chapter B, is that it reuses an exist- ing connection, thereby improving response times by avoiding TCP/IP overhead. As described here, making sure your servers support Keep-Alive also reduces DNS look- ups, especially for Firefox users. Reduce DNS lookups by using Keep-Alive and fewer domains.

Articles in this issue

Links on this page

Archives of this issue

view archives of flash service - High_Performance_Web_Sites