Issue link: https://read.uberflip.com/i/1146286
122 | Chapter 15: Deconstructing 10 Top Sites Why did the Google home page preload nav_logo3.png if it's not used on the search results page? It's possible it's preloaded for other Google sites, but I visited http:// froogle.google.com, http://catalogs.google.com, http://books.google.com, and several others. None of them used nav_logo3.png. Perhaps this is left over from a previous design and just hasn't been cleaned up. It could also be a foreshadowing of a future site integration strategy (hence the "3"). Despite this apparently wasteful download on the Google home page, don't be dissuaded. Preloading is a good strategy for improving the page load times of secondary pages on your site. Another interesting performance optimization in the Google home page is the use of the SCRIPT DEFER attribute. In Chapter 6, I describe how the DEFER attribute doesn't completely resolve the negative performance impacts that scripts have when they block downloads and rendering. However, that was in regard to external scripts; in this case, the script is inlined: Using the DEFER attribute avoids possible rendering delays by telling the browser to continue rendering and execute the JavaScript later, but I've never seen it used for inline scripts. The justification for using it with an inline script may be that parsing and executing the JavaScript code could delay rendering the page. In this case, how- ever, a problem is that after this SCRIPT block, there is a link that relies on the togDisp function to display a pop-up DIV of "more" links: more If using the DEFER attribute allowed the page to render without executing the togDisp function definition, a race condition would be created. If the "more" link is rendered and the user clicks on it before the JavaScript is executed, an error would occur. The use of DEFER on inline scripts is an area for further investigation. These suggestions, however, are far beyond the typical performance improvements needed on most sites. The Google page scores a perfect 100 in YSlow—it is one of the fastest pages on the Internet.

