Slide 1

Slide 1 text

Building Faster Websites

Slide 2

Slide 2 text

http://www.slideshare.net/mattfarina

Slide 3

Slide 3 text

Matt Farina HP Cloud Co-Author of Drupal 7 Module Development Core Contributor Over 6.5 Years With Drupal (mfer)

Slide 4

Slide 4 text

CENSORED Company Name

Slide 5

Slide 5 text

“The web is getting fatter, as much as 25 percent fatter in the last year alone.” http://www.webmonkey.com/2011/11/latest-stats-say-were-building-a-fatter-slower-web/

Slide 6

Slide 6 text

“size optimization seems to have gone out the window.” http://www.webmonkey.com/2011/11/latest-stats-say-were-building-a-fatter-slower-web/

Slide 7

Slide 7 text

Why Does It Matter?

Slide 8

Slide 8 text

By 2015 Mobile will pass Desktop for Internet Usage http://mashable.com/2010/04/13/mobile-web-stats/

Slide 9

Slide 9 text

“57 percent of online shoppers will wait three seconds or less before abandoning the site” http://www.akamai.com/html/about/press/releases/2010/press_061410.html

Slide 10

Slide 10 text

“85% of mobile users expect sites to load as fast or faster than sites on the desktop.” http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-user-expectations/mobile-device-users-expect-sites-to-load-fast/

Slide 11

Slide 11 text

“Yahoo! reported that making pages just 400 milliseconds slower resulted in a traffic drop of up to 9%.” http://www.slideshare.net/stoyan/yslow-20-presentation

Slide 12

Slide 12 text

SEO http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

15% 85% Front End Back End 3% 97% Front End Back End Desktop Mobile http://www.readwriteweb.com/hack/2011/06/mobile-page-response.php

Slide 15

Slide 15 text

Bandwidth and Speed

Slide 16

Slide 16 text

Smaller Images Original 33% Smaller

Slide 17

Slide 17 text

ImageOptim (mac) smushit.com

Slide 18

Slide 18 text

Minify JS Original 24% the Size

Slide 19

Slide 19 text

UglifyJS https://github.com/mishoo/UglifyJS/

Slide 20

Slide 20 text

Legalities of Minifying GPL • I’m NO Lawyer! This is not legal advice. • JS downloaded to the browser is a form of distribution. • The source (non-minified) must be linked to or available. This could be a link in a comment in a minifed file. • Preserve copyright / attribution comments.

Slide 21

Slide 21 text

GZIP Compression mod_deflate - http://httpd.apache.org/docs/2.2/mod/ mod_deflate.html

Slide 22

Slide 22 text

RTT and Connections

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

6 Connections Per Domain

Slide 25

Slide 25 text

IE 6/7 Two Per Domain

Slide 26

Slide 26 text

iOS 5 Android 2.2 Android 2.3 Blackberry 6 4 6 5 Max Connections per Host

Slide 27

Slide 27 text

Image Sprites

Slide 28

Slide 28 text

spritecow.com

Slide 29

Slide 29 text

JS and CSS Aggregation }

Slide 30

Slide 30 text

Expires Header

Slide 31

Slide 31 text

mod_expires http://httpd.apache.org/docs/2.2/mod/mod_expires.html

Slide 32

Slide 32 text

# Begin Cache Control ExpiresActive On ExpiresByType image/gif A604800 ExpiresByType image/png A604800 ExpiresByType image/jpeg A604800 300 = 5 Minute 3600 = 1 Hour 86400 = 1 DAY 259200 = 3 DAY 604800 = 1 WEEK 2419200 = 1 MONTH 29030400 = 12 MONTH

Slide 33

Slide 33 text

10x

Slide 34

Slide 34 text

Mobile Hardware • Maybe a 1 Ghz mobile processor • 500 Mb - 1 Gb RAM (shared) • 7 - 90 Million Triangles per Second Drawing

Slide 35

Slide 35 text

Do you remember when Facebook took down the Internet?

Slide 36

Slide 36 text

var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; ga.setAttribute('async', 'true'); document.documentElement.firstChild.appendChild(ga); })(); async var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http:// www.");document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/ javascript'%3E%3C/script%3E")); try{ var pageTracker = _gat._getTracker("UA-1362581-1");pageTracker._trackP ageview(); } catch(err) {} sync

Slide 37

Slide 37 text

Tools

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

Questions?