website performance optimisation

45
stevesouders.com/docs/webstock-20110217.pptx Disclaimer: This content does not necessarily reflect the opinions of my employer. Web Performance Optimization flickr.com/photos/ddfic/722634166/

Upload: webstock

Post on 27-Jan-2015

112 views

Category:

Technology


2 download

DESCRIPTION

Slides for Steves Souders at Webstock 11

TRANSCRIPT

Page 1: Website performance optimisation

stevesouders.com/docs/webstock-20110217.pptx

Disclaimer: This content does not necessarily reflect the opinions of my employer.

Web Performance

Optimization

flickr.com/photos/ddfic/722634166/

Page 2: Website performance optimisation

flickr.com/photos/bekahstargazing/318930460/

Page 3: Website performance optimisation

2004

Page 4: Website performance optimisation

#1. Speed: “First and foremost, we believe that

speed is more than a feature. Speed is the most

important feature.”

carsonified.com/blog/business/fred-wilsons-10-golden-principles-of-successful-web-apps/

Page 5: Website performance optimisation

en.oreilly.com/velocity2009/public/schedule/detail/8523

Page 6: Website performance optimisation

en.oreilly.com/velocity2009/public/schedule/detail/8523

Page 7: Website performance optimisation

Yahoo!

0.4 sec slower

traffic 5-9%

slideshare.net/stoyan/yslow-20-presentationslideshare.net/stoyan/dont-make-me-wait-or-building-highperformance-web-applications

Page 8: Website performance optimisation

…shaved 2.2 seconds off the average page load

time and increased download conversions by

15.4%!

blog.mozilla.com/metrics/category/website-optimization/

Page 9: Website performance optimisation

blog.mozilla.com/metrics/category/website-optimization/

…shaved 2.2 seconds off the average page load

time and increased download conversions by

15.4%!

en.oreilly.com/velocity2009/public/schedule/detail/7709

Page 10: Website performance optimisation

en.oreilly.com/velocity2008/public/schedule/detail/3632

Page 11: Website performance optimisation

slideshare.net/EdmundsLabs/how-edmunds-got-in-the-fast-lane-80-reduction-in-page-load-time-in-3-simple-steps-6593377

Page 12: Website performance optimisation

Site speed in search rank

Screen shot of blog post…we've decided to take site speed into account in

our search rankings.

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

Page 13: Website performance optimisation

drives traffic

improves UX

increases revenue

reduces costs flickr.com/photos/pedromourapinheiro/3123885534/

Web

Performance

OptimizationWPO

Page 14: Website performance optimisation

What makes sites feel slow?

flickr.com/photos/kevincollins/234678305/

Page 15: Website performance optimisation

[next page being loaded]

(lack of)

Progressive Rendering

flickr.com/photos/kevincollins/234678305/

Page 16: Website performance optimisation

Yahoo

Bing

Ask

Google

does this matter?

Page 17: Website performance optimisation
Page 18: Website performance optimisation

Progressive

Enhancementdeliver HTML

defer JS

avoid DOM

decorate later

Page 19: Website performance optimisation

Progressive

Enhancement

Progressive Rendering

Page 20: Website performance optimisation

<script src="A.js"> blocks parallel downloads and rendering

7 secs: IE 8-9, FF 3.6, Chr 6, Saf 4

9 secs: IE 6-7, FF 3.0, Chr 1, Op 9-10, Saf 3

Why focus on JavaScript?

Page 21: Website performance optimisation

Loading Scripts Without Blocking

XHR Eval

XHR Injection

Script in Iframe

Script DOM Element

Script Defer

document.write Script Tag

Page 22: Website performance optimisation

Script DOM Elementvar se = document.createElement('script');

se.src = 'http://anydomain.com/A.js';

document.getElementsByTagName('head')

[0].appendChild(se);

script & page domains can differ

may not preserve execution order

Page 23: Website performance optimisation

Meebo Iframed JSvar iframe = document.createElement('iframe');

document.body.appendChild(iframe);

var doc = iframe.contentWindow.document;

doc.open().write('<body onload="insertJS()">');

doc.close();

loads asynchronously

delays parent’s load event: FF, Chr, Saf

great for 3rd

party scripts

better for sandboxing & security

avoids iframe src roundtrip

Page 24: Website performance optimisation

GMail Mobile<script type="text/javascript">

/*

var ...

*/

</script>

get script DOM element's text

remove comments

eval() when invoked

inline or iframe

awesome for prefetching JS that might (not) be needed

Page 25: Website performance optimisation

ControlJSa JavaScript module for making scripts load faster

just change HTML

inline & external scripts

<script type="text/cjs" data-cjssrc="main.js">

</script>

<script type="text/cjs">

var name = getName();

</script>

Page 26: Website performance optimisation

ControlJSa JavaScript module for making scripts load faster

downloads without executing<script type="text/cjs" data-cjssrc="main.js” data-cjsexec=false>

<script>

later (if needed):CJS.execScript(src);

Page 27: Website performance optimisation

ControlJSa JavaScript module for making scripts load faster

handles (some) document.write• override document.write for each

script• set SPAN innerHTML if there’s a write• parse out SCRIPT tags & add SCRIPT

elem

better solutions:• Aptimize – http://www.aptimize.com/

• GhostWriter – http://digital-fulcrum.com/solutions /ghostwriter-complete-control/

Page 28: Website performance optimisation

slideshare.net/CMSummit/ms-internet-trends060710final

Page 29: Website performance optimisation

slideshare.net/CMSummit/ms-internet-trends060710final

Page 30: Website performance optimisation

slideshare.net/CMSummit/ms-internet-trends060710final

Page 31: Website performance optimisation
Page 32: Website performance optimisation
Page 33: Website performance optimisation
Page 34: Website performance optimisation
Page 35: Website performance optimisation
Page 36: Website performance optimisation

to intr to intr

Twitter iPhone app

open timeline

Page 37: Website performance optimisation

Twitter iPhone app

execute search

Page 38: Website performance optimisation

Twitter iPhone app

open timeline

Page 39: Website performance optimisation

just released

this morning

1am

Page 40: Website performance optimisation
Page 41: Website performance optimisation
Page 42: Website performance optimisation
Page 43: Website performance optimisation
Page 44: Website performance optimisation

speed matters

focus on JavaScript

more visibility into mobile

takeaways

flickr.com/photos/34771728@N00/361526991/

Page 45: Website performance optimisation

Steve Souders

@souders

stevesouders.com/docs/webstock-20110217.pptx

flickr.com/photos/myklroventine/4062102754/