making the web faster

38
1 Making the Web Faster National Capital Area Google Technology Users Group Patrick Meenan Twitter: @PatMeenan [email protected]

Upload: patrick-meenan

Post on 09-May-2015

5.115 views

Category:

Technology


0 download

DESCRIPTION

Presentation from the June 28, 2011 National Capital Area Google Technology Users Group on some of Google's efforts to make the web faster.

TRANSCRIPT

Page 1: Making the web faster

1

Making the Web FasterNational Capital Area Google Technology Users Group

Patrick MeenanTwitter: @[email protected]

Page 2: Making the web faster

Waterfalls

Page 3: Making the web faster

Waterfall Components

33

DNS

LookupHTTP Request

Socket

Connect

Content

Download

Page 4: Making the web faster

Front-End vs Back-End

4

Base Page

Back-End Processing

Page 5: Making the web faster

High Performance Websites

1. Make fewer HTTP requests

2. Use CDN

3. Add expires header

4. Gzip Components

5. Put stylesheets at the top

6. Put scripts 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

14.Make Ajax cacheable

15.Sharding domains

5

Page 6: Making the web faster

Measuring Performance

6

Page 7: Making the web faster

Synthetic Measurement

www.webpagetest.org

7

Page 8: Making the web faster

Real User Measurement

_gaq.push(['_trackPageLoadTime']);

8

Page 9: Making the web faster

Navigation Timing

window.performance.timing

9

Page 10: Making the web faster

Chrome Developer Tools

10

Page 11: Making the web faster

Optimization Checking

11

Page 12: Making the web faster

Page Speed

• http://code.google.com/speed/page-speed/

• Chrome and Firefox Extensions

12

Page 13: Making the web faster

Page Speed Online

http://pagespeed.googlelabs.com/

13

Page 14: Making the web faster

WebPagetest

14

Page 15: Making the web faster

Making it Faster – Network Layer

15

Page 16: Making the web faster

TCP Initial Congestion Window

16

4K 8K 16K 32K

This:

Is Really This (Current OS’s):

Linux 2.6.39:

15K 30K …

Page 17: Making the web faster

SPDY

• Multiplexed streams

• Request prioritization

• HTTP header compression

• Server push

• Server hint

• 10-50% improvement in load times

17

Page 18: Making the web faster

TLS Improvements

• False Start

• Snap Start

18

SSL Negotiation

Page 19: Making the web faster

Making it Faster – Front-End

19

Page 20: Making the web faster

mod_pagespeed

http://code.google.com/speed/page-speed/docs/module.html

• Apache module

• GoDaddy

• Dreamhost

• Automatic Image Compression & Resizing

• Minify CSS, JavaScript and HTML

• Inline small images, CSS, and JavaScript

• Cache Extension

• CSS/Javascript Combining

• Domain Mapping

• Domain Sharding

20

Page 21: Making the web faster

mod_pagespeed improvement

21

Page 22: Making the web faster

androidacademy.com timeline (median of 50 runs)

22

Page 23: Making the web faster

Instant Pages

23

http://youtu.be/_Jn93FDx9oI?hd=1

Page 24: Making the web faster

Instant Pages

<link rel=prerender href=“…”>

24

Page 25: Making the web faster

WebPagetest

25

Page 26: Making the web faster

The basics – testing “pages”

• www.webpagetest.org

• Submit an URL….

Page 27: Making the web faster

From multiple locations globally…

27

Page 28: Making the web faster

The basics – get “results”

Performance and optimization information

Page 29: Making the web faster

What it looks like

Page 30: Making the web faster

What it looks like

Page 31: Making the web faster

What if…

Page 32: Making the web faster

Comparing arbitrary tests

Page 33: Making the web faster

The comparison

Page 35: Making the web faster

More advanced capabilities

Automating Rich Applications

• Authenticating into form-protected applications

• Interacting with Web Apps (Mail, Calendar, etc)

• Testing a navigation flow from one page to another

• Execute arbitrary Javascript

REALLY Advanced Options

• Re-writing DNS lookups (directing traffic to a test/staging box)

• Custom User-Agent strings & HTTP Headers

• Pre-populating cookies

• Custom test end conditions

• Capture Dynatrace Ajax Edition sessions

• Tcpdump capture

35

Page 36: Making the web faster

Private Instances

http://sites.google.com/a/webpagetest.org/docs/private-instances

Bulk Testing

EC2 Agent Public AMI’s

• US (East/West)

• Europe

• Asia (Singapore/Tokyo)

Public Projects

• HTTP Archive

• Blaze Mobitest

Page 37: Making the web faster

REST API

Submit tests (API key required for public instance)

• Check status

• Fetch Result

1.XML

2.HAR

http://sites.google.com/a/webpagetest.org/docs/advanced-

features/webpagetest-restful-apis

Page 38: Making the web faster

WPT Monitor

Tony Perkins (Sabre)

http://www.webpagetest.org/forums/forumdisplay.php?fid=21