SlideShare a Scribd company logo
Prebrowsing

souders@google.com
stevesouders.com/docs/velocity-prebrowsing-20131015.pptx
Disclaimer: This content does not necessarily reflect the opinions of my employer.
flickr.com/photos/adrianhu/8731191034/
flickr.com/photos/garylerude/7524325808/
flickr.com/photos/mn_francis/388474284/

flickr.com/photos/garylerude/7524325808/
Prebrowsing - Velocity NY 2013
Prebrowsing

TM

I made this word up
& own the domain

get what the browser needs
before the browser needs it
y ! cache?
first time visit
cleared/purged
expired
modified
flickr.com/photos/athrasher/2823255013/
zen of prebrowsing
some techniques risk false positives
some don’t
sometimes the risk is high
sometimes it’s not
browsers do some prebrowsing
devs have to do some too

really? me?

flickr.com/photos/josefeliciano/3849557951/
just the facts
<link rel="dns-prefetch"...
!
<link rel="prefetch"...!
<link rel="prerender"...!
DNS pre-resolution
TCP pre-connect
prefresh
preloader
flickr.com/photos/dalydose/5492111447/
owner
dev

<link rel="dns-prefetch"...
!

dev

<link rel="prefetch"...!

dev

<link rel="prerender"...!

browser

DNS pre-resolution

browser

TCP pre-connect

browser

prefresh

browser
& dev

preloader

flickr.com/photos/dalydose/5492111447/
when
prev

<link rel="dns-prefetch"...
!

prev

<link rel="prefetch"...!

prev

<link rel="prerender"...!

xition

DNS pre-resolution

xition

TCP pre-connect

xition

prefresh

current

preloader

flickr.com/photos/dalydose/5492111447/
prev

xition current

<link rel="dns-prefetch"...!
<link rel="prefetch"...!
<link rel="prerender"...!

DNS pre-resolve
TCP pre-connect
prefresh

preloader
prev
before user intention is certain

<link rel="dns-prefetch"...!
<link rel="prefetch"...!

<link rel="prerender"...!

risk of false positives (wasteful)
high confidence scenarios exist
Prebrowsing - Velocity NY 2013
prev: dns-prefetch
<link rel="dns-prefetch"
href="//cartoonnetwork.com">!

cost is low – less risk
may open TCP connections
ex: airbnb.com
<head>!
<link rel="dns-prefetch" href="//a0.muscache.com”>!
<link rel="dns-prefetch" href="//a1.muscache.com”>!
<link rel="dns-prefetch" href="//a2.muscache.com”>

!

chromium.org/developers/design-documents/dns-prefetching

flickr.com/photos/chpaquette/507056729/
blog.chromium.org/2008/09/dns-prefetching-or-pre-resolving.html
chrome://histograms/DNS
prev: browser support
dns-prefetch
Chrome

22+

Chrome Mobile

29+

Firefox

22+

Firefox Mobile

24+

IE

11*

* preliminary and subject to change

flickr.com/photos/himmelskratzer/212559623/
prev: prefetch
<link rel="prefetch" href="http://
cartoonnetwork.com/utils.js">!
4.12.5.9 Link type "prefetch”
The prefetch keyword may be used with link, a, and area elements. This
keyword creates an external resource link.
The prefetch keyword indicates that preemptively fetching and caching the
specified resource is likely to be beneficial, as it is highly likely that the
user will require this resource.

!

There is no default type for resources given by the prefetch keyword.

whatwg.org/specs/web-apps/current-work/#link-type-prefetch

What about “The resource should be downloaded.”?!
flickr.com/photos/captivated/1564878334/
prev: prefetch questions
are they downloaded?
how many?
prefetched immediately?
what’s the download priority?
what happens on page transition?
is https supported?
flickr.com/photos/captivated/1564878334/
also http://prebrowsing.com/
Prebrowsing - Velocity NY 2013
prev: prefetch answers
Downloads
Resource
Android 4

Y

Chrome 31+*

Y

Firefox 23+

Y

Firefox Mobile 24+

Y

Opera 15+

Y

* --prerender=enable!

flickr.com/photos/captivated/1564878334/
prev: prefetch answers
Downloads
# in
Resource Parallel
Android 4

Y

6 (1)

Chrome 31+*

Y

10 (6)

Firefox 23+

Y

1 (1)

Firefox Mobile 24+

Y

1 (1)

Opera 15+

Y

10 (6)

sharded domains
* --prerender=enable!

(same domain)

flickr.com/photos/captivated/1564878334/
prev: prefetch answers
Downloads
# in
After
Resource Parallel Onload
Android 4

Y

6 (1)

Y

Chrome 31+*

Y

10 (6)

N

Firefox 23+

Y

1 (1)

Y

Firefox Mobile 24+

Y

1 (1)

Y

Opera 15+

Y

10 (6)

N

sharded domains
* --prerender=enable!

(same domain)

flickr.com/photos/captivated/1564878334/
prev: prefetch answers
Downloads
# in
After
Resource Parallel Onload

Lowest
Priority

Android 4

Y

6 (1)

Y

n/a

Chrome 31+*

Y

10 (6)

N

N

Firefox 23+

Y

1 (1)

Y

n/a

Firefox Mobile 24+

Y

1 (1)

Y

n/a

Opera 15+

Y

10 (6)

N

N

sharded domains
* --prerender=enable!

(same domain)

flickr.com/photos/captivated/1564878334/
prev: prefetch answers
Downloads
# in
After
Resource Parallel Onload

Lowest
Priority

Page
Xition

Android 4

Y

6 (1)

Y

n/a

cancel

Chrome 31+*

Y

10 (6)

N

N

cancel

Firefox 23+

Y

1 (1)

Y

n/a

cancel

Firefox Mobile 24+

Y

1 (1)

Y

n/a

cancel

Opera 15+

Y

10 (6)

N

N

cancel

sharded domains
* --prerender=enable!

(same domain)

flickr.com/photos/captivated/1564878334/
prev: prefetch Tips
make resources cacheable
do critical resources: HTML, JS, CSS
add "Accept-Ranges: bytes" header

flickr.com/photos/captivated/1564878334/
prev: prerender
<link rel="prerender" href="http://
cartoonnetwork.com/">!

it’s like swapping in a hidden tab(by)
caching headers not a factor
JS is executed (page visiblity API)
high cost – high risk
developers.google.com/chrome/whitepapers/prerender
chrome://net-internals/#prerender

flickr.com/photos/aftab/2640901551/
--prerender="enabled"!
chrome://net-internals/#prerender
prev: onmousedown
previously prev:
before user intention is known
risk of false positives (wasteful)

reduce risk using onmousedown:
var l = document.createElement('link'); !
l.rel = "prefetch";
!
l.href = "/utils.js";
!
document.getElementsByTagName('head')
[0].appendChild(l); !
flickr.com/photos/braydawg/185092747/
prev: browser support
dns-prefetch
Android 4

prefetch

prerender

4

Chrome

22+

Chrome Mobile

29+

Firefox

22+

23+

Firefox Mobile

24+

24+

IE

11**

11**

Opera

31+*

22+

11**

15+

* --prerender=enable!
** preliminary and subject to change

flickr.com/photos/himmelskratzer/212559623/
xition
DNS pre-resolve
TCP pre-connect
prefresh

HUGE

window
of
opportunity
xition
w3.org/TR/navigation-timing/
xition

DNS pre-resolve
TCP pre-connect
prefresh
xition: DNS pre-resolve
browser resolves DNS before needed
•  start pages

aosabook.org/en/posa/high-performance-networking-in-chrome.html
chromium.org/developers/design-documents/dns-prefetching
flickr.com/photos/aukirk/8375505268/
chrome://dns/
xition: DNS pre-resolve
browser resolves DNS before needed
•  start pages
•  typing URL or search

aosabook.org/en/posa/high-performance-networking-in-chrome.html
chromium.org/developers/design-documents/dns-prefetching
flickr.com/photos/aukirk/8375505268/
chrome://predictors/
xition: DNS pre-resolve
browser resolves DNS before needed
•  start pages
•  typing URL or search
•  document’s HREFs & SRCs
•  onhover, mousedown

browser pre-resolves RESOURCE
domains during xition
aosabook.org/en/posa/high-performance-networking-in-chrome.html
chromium.org/developers/design-documents/dns-prefetching
flickr.com/photos/aukirk/8375505268/
chrome://dns/
xition: TCP pre-connect
next step above DNS pre-resolve
for high confidence navigations

flickr.com/photos/sjunnesson/4906652829/
chrome://predictors/
chrome://dns/
Prebrowsing - Velocity NY 2013
TM

xition: prefresh

I didn’t make this word up
Michael Kleber did

remember web pages’s resources
when web page is re-requested,
preload high confidence resources
avoids: 200, 304, disk i/o
in memory when needed
Chrome: --speculative-resourceprefetching="enabled"!
flickr.com/photos/chpaquette/507056729/
chrome://predictors/
current
preloader
done by browser automatically,
but devs need know what to expect

flickr.com/photos/frankfarm/191415409/
preloader
biggest browser performance improvement
EVER!
motivated by script downloads
before: sequential – parser blocked
after: parallel – lookahead parser looks ahead

lots of (new) logic
load scripts & stylesheets early
load images later
flickr.com/photos/matti_frisk/2717599581/
preloader surprizes
chegg.com – scripts at bottom
which browsers?

flickr.com/photos/matti_frisk/2717599581/
preloader surprizes
JS responsive images queued last
•  IMG tag seen before JS executes
•  bad if IMGs are lower priority
•  good to shard domains

scripts “at the bottom” loaded
“at the top”
•  steal connections
•  critical IMGs delayed
flickr.com/photos/matti_frisk/2717599581/
Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013
flickr.com/photos/bekahstargazing/318930460/
Takeaways
dev

<link rel="dns-prefetch"...
!

dev

<link rel="prefetch"...!

dev

<link rel="prerender"...!

browser

DNS pre-resolution

browser

TCP pre-connect

browser

prefresh

browser
& dev

preloader
flickr.com/photos/myklroventine/4062102754/
Prebrowsing - Velocity NY 2013
Steve Souders
souders@google.com
stevesouders.com/docs/velocity-prebrowsing-20131015.pptx
flickr.com/photos/nj_dodge/187190601/

More Related Content

PPTX
High Performance Mobile (SF/SV Web Perf)
PPTX
High Performance HTML5 (SF HTML5 UG)
PDF
Preconnect, prefetch, prerender...
PPTX
Souders WPO Web2.0Expo
PPTX
Design+Performance
PPTX
Design+Performance Velocity 2015
PPTX
do u webview?
PPTX
@media - Even Faster Web Sites
High Performance Mobile (SF/SV Web Perf)
High Performance HTML5 (SF HTML5 UG)
Preconnect, prefetch, prerender...
Souders WPO Web2.0Expo
Design+Performance
Design+Performance Velocity 2015
do u webview?
@media - Even Faster Web Sites

What's hot (20)

PPT
Web 2.0 Expo: Even Faster Web Sites
PPTX
JavaScript Performance (at SFJS)
PPTX
How fast are we going now?
PPTX
High Performance Web Components
PDF
State of the resource timing api
PDF
[jqconatx] Adaptive Images for Responsive Web Design
PDF
Mobile Web Speed Bumps
PPTX
Browser Wars Episode 1: The Phantom Menace
PDF
Web Performance Optimierung - DWX13
PDF
Progressive Enhancement 2.0 (Conference Agnostic)
PDF
Stefan Judis "Did we(b development) lose the right direction?"
PPTX
Website performance optimisation
PPTX
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
PDF
High Performance JavaScript (Amazon DevCon 2011)
PDF
Hardening WordPress - Friends of Search 2014 (WordPress Security)
PDF
Real World Web Standards
KEY
HTML5 Video Player - HTML5 Dev Conf 2012
PPTX
Hardening WordPress - SAScon Manchester 2013 (WordPress Security)
PPTX
High Performance JavaScript (CapitolJS 2011)
PDF
Web Page Test - Beyond the Basics
Web 2.0 Expo: Even Faster Web Sites
JavaScript Performance (at SFJS)
How fast are we going now?
High Performance Web Components
State of the resource timing api
[jqconatx] Adaptive Images for Responsive Web Design
Mobile Web Speed Bumps
Browser Wars Episode 1: The Phantom Menace
Web Performance Optimierung - DWX13
Progressive Enhancement 2.0 (Conference Agnostic)
Stefan Judis "Did we(b development) lose the right direction?"
Website performance optimisation
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
High Performance JavaScript (Amazon DevCon 2011)
Hardening WordPress - Friends of Search 2014 (WordPress Security)
Real World Web Standards
HTML5 Video Player - HTML5 Dev Conf 2012
Hardening WordPress - SAScon Manchester 2013 (WordPress Security)
High Performance JavaScript (CapitolJS 2011)
Web Page Test - Beyond the Basics
Ad

Similar to Prebrowsing - Velocity NY 2013 (20)

PDF
More Than You Ever Wanted to Know About Resource Hints - Harry Roberts (CSS W...
PDF
BD Conf: Visit speed - Page speed is only the beginning
PDF
A SURVEY ON WEB PRE-FETCHING AND WEB CACHING TECHNIQUES IN A MOBILE ENVIRONMENT
PDF
Web performance optimization - MercadoLibre
PDF
Dynamic page caching for Magnolia 5.4
PPTX
Analysis of Google Page Speed Insight
PDF
Web performance mercadolibre - ECI 2013
PDF
Hacking Web Performance
PDF
Hacking Web Performance 2019
PDF
2 network tips
PDF
Web Performance Part 2 "Network tips"
PDF
Link prefetching presentation
PPTX
Building Lightning Fast Websites (for Twin Cities .NET User Group)
PPTX
Service workers - Velocity 2016 Training
PDF
Swapnil_Chaudhari_paper
KEY
Page Performance
PPTX
Mini-Training: To cache or not to cache
PPTX
Advanced Caching Concepts @ Velocity NY 2015
KEY
Faster Frontends
PPTX
5 steps to faster web sites & HTML5 games - updated for DDDscot
More Than You Ever Wanted to Know About Resource Hints - Harry Roberts (CSS W...
BD Conf: Visit speed - Page speed is only the beginning
A SURVEY ON WEB PRE-FETCHING AND WEB CACHING TECHNIQUES IN A MOBILE ENVIRONMENT
Web performance optimization - MercadoLibre
Dynamic page caching for Magnolia 5.4
Analysis of Google Page Speed Insight
Web performance mercadolibre - ECI 2013
Hacking Web Performance
Hacking Web Performance 2019
2 network tips
Web Performance Part 2 "Network tips"
Link prefetching presentation
Building Lightning Fast Websites (for Twin Cities .NET User Group)
Service workers - Velocity 2016 Training
Swapnil_Chaudhari_paper
Page Performance
Mini-Training: To cache or not to cache
Advanced Caching Concepts @ Velocity NY 2015
Faster Frontends
5 steps to faster web sites & HTML5 games - updated for DDDscot
Ad

More from Steve Souders (15)

PPTX
Make JavaScript Faster
PDF
Metrics of Joy
PPTX
The Perception of Speed
PPTX
High Performance Web Components
PPTX
Cache is King
PPTX
High Performance Snippets
PPTX
Your Script Just Killed My Site
PPTX
Web Directions South - Even Faster Web Sites
PPTX
Souders WPO Web 2.0 Expo
PPTX
JSConf US 2010
PDF
CouchDB Google
PPT
Even Faster Web Sites at jQuery Conference '09
PPTX
Browserscope Launch at TAE
PPT
Even Faster Web Sites at The Ajax Experience
PPT
SXSW: Even Faster Web Sites
Make JavaScript Faster
Metrics of Joy
The Perception of Speed
High Performance Web Components
Cache is King
High Performance Snippets
Your Script Just Killed My Site
Web Directions South - Even Faster Web Sites
Souders WPO Web 2.0 Expo
JSConf US 2010
CouchDB Google
Even Faster Web Sites at jQuery Conference '09
Browserscope Launch at TAE
Even Faster Web Sites at The Ajax Experience
SXSW: Even Faster Web Sites

Recently uploaded (20)

PPT
Aboriginals Achievements in Society and Community Development
DOCX
NFL Dublin Vikings Turn to Speed with Tai Felton.docx
PPTX
International Football (International football is a type of soccer in which n...
PPTX
BADMINTON-2ND-WEEK-FUNDAMENTAL-SKILLS.pptx
PDF
BOOK MUAYTHAI THAI FIGHT ALEXANDRE BRECK
DOCX
FA Cup Final 2026 Siring: Arne Slot Crit
PPTX
Sports Writing by SHS Teacher Roel A. Naza
DOCX
NFL Dublin Injury Ends Season for Former Vikings Standout.docx
PDF
Best All-Access Digital Pass me .... pdf
PPTX
Best All-Access Digital Pass me .pptxxxx
DOCX
From Playgrounds to Pitches Empowering the Next Generation.docx
PPTX
Performance Analytics in the field of sports.pptx
DOCX
How FIFA 2026 Is Changing Vancouver Before Kickoff.docx
DOCX
NFL Dublin Addison Fuels Steelers-Vikings Showdown.docx
PDF
Understanding Volunteering_ A Look at Its True Meaning by David Bennett Gallo...
DOCX
NFL Dublin Will Howard’s Preseason Be Over After Hand Injury.docx
PDF
How Teams Compete to Find Sponsors for Their Jerseys
DOCX
NFL Dublin Addison Returns Home To Haunt Pittsburgh.docx
PDF
volleyball lesson.powerpoint presentation
PDF
Download GTA 5 For PC (Windows 7, 10, 11)
Aboriginals Achievements in Society and Community Development
NFL Dublin Vikings Turn to Speed with Tai Felton.docx
International Football (International football is a type of soccer in which n...
BADMINTON-2ND-WEEK-FUNDAMENTAL-SKILLS.pptx
BOOK MUAYTHAI THAI FIGHT ALEXANDRE BRECK
FA Cup Final 2026 Siring: Arne Slot Crit
Sports Writing by SHS Teacher Roel A. Naza
NFL Dublin Injury Ends Season for Former Vikings Standout.docx
Best All-Access Digital Pass me .... pdf
Best All-Access Digital Pass me .pptxxxx
From Playgrounds to Pitches Empowering the Next Generation.docx
Performance Analytics in the field of sports.pptx
How FIFA 2026 Is Changing Vancouver Before Kickoff.docx
NFL Dublin Addison Fuels Steelers-Vikings Showdown.docx
Understanding Volunteering_ A Look at Its True Meaning by David Bennett Gallo...
NFL Dublin Will Howard’s Preseason Be Over After Hand Injury.docx
How Teams Compete to Find Sponsors for Their Jerseys
NFL Dublin Addison Returns Home To Haunt Pittsburgh.docx
volleyball lesson.powerpoint presentation
Download GTA 5 For PC (Windows 7, 10, 11)

Prebrowsing - Velocity NY 2013