why is my website slow?

19
Why is My Site Slow? Optimising websites & catering for the mobile web Sean Ockert

Upload: testpilot

Post on 12-Apr-2017

1.031 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Why is my website slow?

Why is My Site Slow?

Optimising websites

& catering for the mobile web

Sean Ockert

Page 2: Why is my website slow?

Why optimise my site?

Mobile phone web-browsing

Users with slow connections

Reduced bandwidth

More responsive experience

Satisfied audience!

Credibility

Page 3: Why is my website slow?

AOL and loading….

10-15% active users (in US) are still on dial-up (down from 45% in 2005)

Remote areas still rely on satellite connections – premium quota

http://www.pewinternet.org/press_release.asp?r=305

3G access integrated into laptops

Page 4: Why is my website slow?

Mobile browsing

Rapidly increasing mobile phone web browsing

- iPhone, blackberry, palm, nokia

- 2.6million iPhone, 1.1million Touch hits/month at Wordpress.com

*http://ma.tt/2008/07/ie6-independence/

3.3Billion phones

Big potential market

Page 5: Why is my website slow?

Impatience - Changing user expectations

Just like accessibility,

a slow loading website can inhibit visitors.

Page load timesusers will tolerate

<1 sec - instantaneous, complete attention

5-10 sec - flipping to another tab

10+ sec - reaching for the back button...

How long is your attention span?

1999

2004

12

Seconds

4

Page 6: Why is my website slow?

So how can I improve my front end?

Page 7: Why is my website slow?

Yahoo’s key performance rules

1. Make fewer HTTP requests

2. Use a CDN

3. Add an Expires header

4. Gzip components

5. Put CSS at the top

6. Put JS at the bottom

7. Avoid CSS expressions

8. Make JS and CSS external

9. Reduce DNS lookups

10. Minify JS

11. Avoid redirects

12. Remove duplicate scripts

13. Configure ETags

+ more…

Things to fix (in order of importance):

Page 8: Why is my website slow?

Why Slow?

Plugin for the Firebug console in Firefox(examines pages based on these criteria)

YSlow

Helps to pinpoint clientside performance bottlenecks

http://developer.yahoo.com/performance/

Page 9: Why is my website slow?

Experiment: Most big sites are not that optimised

F 38%

F 39%

20 JS files!?

F 51%

Page 10: Why is my website slow?

A little bit better…

F 59%

F 58%

F 56%

Page 11: Why is my website slow?

A 99%

Ah, simplicity

Page 12: Why is my website slow?

Build another lane and traffic will fill it

Number of page objects doubled since 2003

0

50

100

150

200

250

300

350

J-95 J-96 J-97 J-98 J-99 J-00 J-01 J-02 J-03 J-04 J-05 J-06 J-07 J-08

0

10

20

30

40

50

60

Average Page Size (kB)

Average number of objects

Sources: Domenech 2007, Gomez 2008

Growth of Average Webpage Size and Number of Objects

312.1

93.7

14.1

25.7

2.3

49.9

*http://www.websiteoptimization.com/speed/tweak/average-web-page

Matching the amount of data to the bandwidth – good idea?

Page 13: Why is my website slow?

Consider how objects load

HTTP requests are expensive

Only 2 HTTP concurrent connections per domain

Collate your CSS and JS files

(The average number of external scripts is 7!*)

Let JS load last

Page 14: Why is my website slow?

Gzip everything!

Can reduce file sizes by over 70%

jquery.js

Uncompressed: 97kB

Minified & gzipped: 16kB!

Gzip works on

CSS, HTML, JS, JSON & XML

by Rune T: www.flickr.com/photos/minebilder/62605938/

Page 15: Why is my website slow?

Squeezing out more performance

Reduce DOM elements

Add expires header on objects (or cache control)

Disable entity tags

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">

Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"

</FilesMatch>

FileETag None

Any others?

Limit cookies

No more than 4 DNS

Add trailing slash to links

Consider optimised png’s instead of gifs (and minimise colours)

Cache AJAX

CSS layouts render faster than tables

Page 16: Why is my website slow?

So does this apply to mobile browsers?

Gzip and caching support for phones?

http://www.cloudfour.com/mobile/

Gzip Support for mobile phones

Gzip

83%

No Gzip

17%

Caching Support for mobile phones

Caching*

68%

No Caching

32%

*Caching only for objects <25kB

Best support from:

Safari Mobile (iPhone)

Opera Mini 3.x

Webkit (Symbian & Android-based)

Very diverse number of browsers

Cloudfour Results (1300 phones)

Page 17: Why is my website slow?

Bit counting

Mobile download quota still a premium

Consider alternative, minimal pages for mobile browsers

*http://chrispederick.com/work/user-agent-switcher/

Can test in mobile browsers using User Agent Switcher*

Smaller screen resolutions

Page 18: Why is my website slow?

Conclusion

It’s easy to optimise the clientside of your site:

- Reduce HTTP requests

- Gzip!

- Properly configure Expires Headersand Etags in your htaccess

Consider support for mobile phone browsers:

- Keep your objects smaller than 25kBfor caching

- Alternate mobile-friendly pages

Page 19: Why is my website slow?

Thankyou!

http://catalyticat.com