More Related Content Similar to Please Don't Touch the Slow Parts (20) More from Federico Galassi (9) Please Don't Touch the Slow Parts1. Please Don’t Touch
the Slow Parts
francesco.fullone@ideato.it
http://www.ideato.it/
federico.galassi@gmail.com
http://federico.galassi.net/
Saturday, May 8, 2010
9. “Time is the only
commodity that matters”
Saturday, May 8, 2010
10. Faster web, more clicks
http://www.stevesouders.com/blog/2009/07/27/wikia-fast-pages-retain-users/
Saturday, May 8, 2010
11. Faster web, better SEO
http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html
Saturday, May 8, 2010
16. Browser resolves
domain name DNS
UDP
www.google.com
72.14.234.104
domain
Saturday, May 8, 2010
17. Browser connects to
web server
WEB
TCP/IP
72.14.234.104
domain connect
Saturday, May 8, 2010
18. Browser sends a
request for a page
WEB
HTTP
GET /language_tools?hl=en
Host: www.google.com
domain connect send
Saturday, May 8, 2010
19. Browser receives a
response with the page
WEB
HTTP
200 OK
domain connect send receive
Saturday, May 8, 2010
24. Requests are
processed in parallel
render
Saturday, May 8, 2010
25. Once upon a time...
Static pages
Few resources
Less javascript
Saturday, May 8, 2010
26. Most time on server
domain connect send receive render
Saturday, May 8, 2010
27. Solution is faster serverside
domain connect send receive render
Saturday, May 8, 2010
29. Most time on browser
domain connect send receive render
Saturday, May 8, 2010
30. Golden rule of faster web
80% of the end user
response time is spent
on the front-end
Saturday, May 8, 2010
32. Why web
slow parts?
Saturday, May 8, 2010
37. Less stuff
Fewer requests
Pages have too
many resources
Concatenate js/css
Css sprites
Less dns requests
Saturday, May 8, 2010
38. Less stuff
Cache requests
Browser download
resources repeatedly
Expires header
Revving Files
External js/css
Remove etags
Saturday, May 8, 2010
39. Smaller stuff
Compress responses
Resources are
too big
Content-Encoding
Gzip
Deflate
Saturday, May 8, 2010
40. Smaller stuff
Minify responses
Resources are
too big
js, css, html
remove formatting
remove comments
use tools
Saturday, May 8, 2010
41. Closer stuff
Use a CDN
Resources are
too far
reduce latency
Saturday, May 8, 2010
43. Scripts block loading
html
document.write
javascript
location.href
css
scripts order
img
javascript
img
flash
Saturday, May 8, 2010
44. Put scripts at bottom
html
css
img
img
flash
javascript
javascript
Saturday, May 8, 2010
45. Unloaded styles
block page rendering
html
img
img
flash
css
Saturday, May 8, 2010
46. Put styles at top
html
css
img
img
flash
Saturday, May 8, 2010
47. Scripts and styles
side effects
dom reflows
css expression reflows
Saturday, May 8, 2010
54. Use tools
at build time
Saturday, May 8, 2010