更快速网站(影印版)
更快速网站(影印版)
Steve Souders
出版时间:2009年12月
页数:231
对于任何成功的网站来说,性能是至关重要的。但伴随着不断增长的丰富内容和Ajax的过度使用,如今的Web应用已经将浏览器推至性能极限。在本书中,Google的Web性能专家和前任雅虎首席网站性能官Steve Souders提供了宝贵的技术,来帮助你优化网站性能。
作者的上一本书是非常畅销的《High Performance Web Sites》,它透露了80%的网页加载时间是花在客户端,使网络开发世界为之震惊。在本书中,Souders和8位专家撰稿人提供了最佳实践和实用建议,用于在三个范畴提高网站的性能:
JavaScript——获取用于了解Ajax性能的建议,编写有效的JavaScript,创建响应程序,加载脚本时不阻止其他组件等等。
Network——学习穿过多个域共享资源,减小图片尺寸而不损失质量,以及使用分块编码(chunked encoding)来更快呈现页面。
Browser——探索内嵌框架(iframe)的替代方案、如何简化CSS选择器和其他技术。
对于当今的富媒体网站和Web 2.0应用来说,速度是至关重要的。有了这本书,你将学习到如何减少你的网站的加载时间,让它们响应得更快。
“本书拥有最近最新的专业知识,能使你的网站飞速运行。我喜欢这本书的编排,有许多主题,每一个都被该领域最受人尊敬的权威人士所探究。我的团队中的每个人都将拥有一本。”
—— Bill Scott,Netflix公司UI工程总监
Steve Souders在Google从事网络性能和开放源码计划方面的工作。他是YSlow (Firebug 性能分析扩展) 的创造者,并且担任Velocity(O’Reilly的网络性能和业务运营会议)的联合主席。Steve经常在会议上或者高级别公司中发言,包括微软、亚马逊、MySpace、LinkedIn、Facebook。
特约作者:
Dion Almaer, Douglas Crockford, Ben Galbraith, Tony Gentilcore, Dylan Schiemann, Stoyan Stefanov, Nicole Sullivan, and
Nicholas C. Zakas
  1. Credits
  2. Preface
  3. 1. Understanding Ajax Performance
  4. Trade-offs
  5. Principles of Optimization
  6. Ajax
  7. Browser
  8. Wow!
  9. JavaScript
  10. Summary
  11. 2. Creating Responsive Web Applications
  12. What Is Fast Enough?
  13. Measuring Latency
  14. When Latency Goes Bad
  15. Threading
  16. Ensuring Responsiveness
  17. Web Workers
  18. Gears
  19. Timers
  20. Effects of Memory Use on Response Time
  21. Virtual Memory
  22. Troubleshooting Memory Issues
  23. Summary
  24. 3. Splitting the Initial Payload
  25. Kitchen Sink
  26. Savings from Splitting
  27. Finding the Split
  28. Undefined Symbols and Race Conditions
  29. Case Study: Google Calendar
  30. 4. Loading Scripts Without Blocking
  31. Scripts Block
  32. Making Scripts Play Nice
  33. XHR Eval
  34. XHR Injection
  35. Script in Iframe
  36. Script DOM Element
  37. Script Defer
  38. document.write Script Tag
  39. Browser Busy Indicators
  40. Ensuring (or Avoiding) Ordered Execution
  41. Summarizing the Results
  42. And the Winner Is
  43. 5. Coupling Asynchronous Scripts
  44. Code Example: menu.js
  45. Race Conditions
  46. Preserving Order Asynchronously
  47. Technique 1: Hardcoded Callback
  48. Technique 2: Window Onload
  49. Technique 3: Timer
  50. Technique 4: Script Onload
  51. Technique 5: Degrading Script Tags
  52. Multiple External Scripts
  53. Managed XHR
  54. DOM Element and Doc Write
  55. General Solution
  56. Single Script
  57. Multiple Scripts
  58. Asynchronicity in the Real World
  59. Google Analytics and Dojo
  60. YUI Loader Utility
  61. 6. Positioning Inline Scripts
  62. Inline Scripts Block
  63. Move Inline Scripts to the Bottom
  64. Initiate Execution Asynchronously
  65. Use Script Defer
  66. Preserving CSS and JavaScript Order
  67. Danger: Stylesheet Followed by Inline Script
  68. Inline Scripts Aren’t Blocked by Most Downloads
  69. Inline Scripts Are Blocked by Stylesheets
  70. This Does Happen
  71. 7. Writing Efficient JavaScript
  72. Managing Scope
  73. Use Local Variables
  74. Scope Chain Augmentation
  75. Efficient Data Access
  76. Flow Control
  77. Fast Conditionals
  78. Fast Loops
  79. String Optimization
  80. String Concatenation
  81. Trimming Strings
  82. Avoid Long-Running Scripts
  83. Yielding Using Timers
  84. Timer Patterns for Yielding
  85. Summary
  86. 8. Scaling with Comet
  87. How Comet Works
  88. Transport Techniques
  89. Polling
  90. Long Polling
  91. Forever Frame
  92. XHR Streaming
  93. Future Transports
  94. Cross-Domain
  95. Effects of Implementation on Applications
  96. Managing Connections
  97. Measuring Performance
  98. Protocols
  99. Summary
  100. 9. Going Beyond Gzipping
  101. Why Does This Matter?
  102. What Causes This?
  103. Quick Review
  104. The Culprit
  105. Examples of Popular Turtle Tappers
  106. How to Help These Users?
  107. Design to Minimize Uncompressed Size
  108. Educate Users
  109. Direct Detection of Gzip Support
  110. 10. Optimizing Images
  111. Two Steps to Simplify Image Optimization
  112. Image Formats
  113. Background
  114. Characteristics of the Different Formats
  115. More About PNG
  116. Automated Lossless Image Optimization
  117. Crushing PNGs
  118. Stripping JPEG Metadata
  119. Converting GIF to PNG
  120. Optimizing GIF Animations
  121. Smush.it
  122. Progressive JPEGs for Large Images
  123. Alpha Transparency: Avoid AlphaImageLoader
  124. Effects of Alpha Transparency
  125. AlphaImageLoader
  126. Problems with AlphaImageLoader
  127. Progressively Enhanced PNG8 Alpha Transparency
  128. Optimizing Sprites
  129. ?ber-Sprite Versus Modular Sprite
  130. Highly Optimized CSS Sprites
  131. Other Image Optimizations
  132. Avoid Scaling Images
  133. Crush Generated Images
  134. Favicons
  135. Apple Touch Icon
  136. Summary
  137. 11. Sharding Dominant Domains
  138. Critical Path
  139. Who’s Sharding?
  140. Downgrading to HTTP/1.0
  141. Rolling Out Sharding
  142. IP Address or Hostname
  143. How Many Domains
  144. How to Split Resources
  145. Newer Browsers
  146. 12. Flushing the Document Early
  147. Flush the Head
  148. Output Buffering
  149. Chunked Encoding
  150. Flushing and Gzip
  151. Other Intermediaries
  152. Domain Blocking During Flushing
  153. Browsers: The Last Hurdle
  154. Flushing Beyond PHP
  155. The Flush Checklist
  156. 13. Using Iframes Sparingly
  157. The Most Expensive DOM Element
  158. Iframes Block Onload
  159. Parallel Downloads with Iframes
  160. Script Before Iframe
  161. Stylesheet Before Iframe
  162. Stylesheet After Iframe
  163. Connections per Hostname
  164. Connection Sharing in Iframes
  165. Connection Sharing Across Tabs and Windows
  166. Summarizing the Cost of Iframes
  167. 14. Simplifying CSS Selectors
  168. Types of Selectors
  169. ID Selectors
  170. Class Selectors
  171. Type Selectors
  172. Adjacent Sibling Selectors
  173. Child Selectors
  174. Descendant Selectors
  175. Universal Selectors
  176. Attribute Selectors
  177. Pseudo-Classes and Pseudo-Elements
  178. The Key to Efficient CSS Selectors
  179. Rightmost First
  180. Writing Efficient CSS Selectors
  181. CSS Selector Performance
  182. Complex Selectors Impact Performance (Sometimes)
  183. CSS Selectors to Avoid
  184. Reflow Time
  185. Measuring CSS Selectors in the Real World
  186. Appendix: Performance Tools
  187. Index
书名:更快速网站(影印版)
作者:Steve Souders
国内出版社:东南大学出版社
出版时间:2009年12月
页数:231
书号:978-7-5641-1934-8
原版书出版商:O'Reilly Media
Steve Souders
 
Steve Souders在Yahoo!担任Chief Performance。他于2000年加盟Yahoo!,在该公司的很多平台和产品团队中工作过。在他到达今天这个位置之前,他就职于My Yahoo!开发团队。
作为Chief Performance Yahoo!,他开发了一系列优秀软件,可以使网站访问速度变得更快。他构建了用于进行性能分析的工具,并将这些优秀软件和工具传播到Yahoo!的各个产品团队中。
在到Yahoo!之前,Steve就职于很多小型或中型公司,包括他和别人一起创办的两个公司——Helix Systems和CoolSync。他还曾就职于General Magic、WhoWhere?和Lycos。在20世纪80年代早期,Steve捕获到了Artificial Intelligence的bug,并在一些公司里进行机器方面的研究。他在维吉尼亚大学得到了系统工程学学士学位,后又在斯坦福大学获得了管理科学和工程学硕士学位。
Steve的兴趣爱好多种多样。他常出现在Freehand System的会议桌上,并且经常光顾Fremont Hills Country Club,还在Sunday School教书。他曾与很多NBA和WNBA球员一起打篮球,但最近他改玩Ultimate Frisbee了。他是Universal Studios Internet Task Force的成员、他重建了有90年历史的车房(carriage house),他还参与了一项吉尼斯世界纪录。他有一位美丽的妻子和三个女儿。
 
 
The animal on the cover of Even Faster Web Sites is a blackbuck antelope (Antilope
cervicapra), an endangered species found mainly in India, also known as the Indian
antelope. The V-shaped horns of the male blackbuck are ringed with several spiral
twists and can be as long as 28 inches. The male’s upper body is black or dark brown,
and its belly and the rings around its eyes are white. The female is light brown and does
not normally have a horn. Blackbucks roam the plains in herds of 15 to 20, feeding on
grasses, flowers, and fruits. On the open plain, the blackbuck is one of the fastest animals
on earth, able to reach speeds of 45 mph and outrun most predators over long
distances.
From the 18th through the early 20th centuries, the blackbuck antelope was the most
hunted wild animal in India. In 1932, several species of Indian deer and antelope, including
the blackbuck, were introduced to Texas for hunting and breeding. Today,
these species live on private hunting ranches and roam the surrounding hill country.
They are so plentiful—having multiplied to 19,000 throughout the state—that many
have been shipped to India to repopulate the native habitat.
Now protected in India by the Wildlife Protection Act of 1972, the blackbuck population
is steady at 50,000 native animals, plus 43,000 descended from Texas and other
populations. Although poaching is still a problem and humans have encroached on its
land, its protected status gained attention in 2006 when Indian film star Salman Khan
was sentenced to five years in jail for killing two blackbucks. According to Hindu
mythology, the blackbuck is considered to be the vehicle of the moon god, Chandrama,
and is believed to bestow prosperity wherever it lives.