SlideShare una empresa de Scribd logo
1 de 63
Descargar para leer sin conexión
Chris Zacharias
Hyper-LightweightWebsites
CEO, FOUNDER @
chris@imgix.com
@zacman85
Web Unleashed - Toronto
October 2, 2018
“If they can build an entire Quake clone1 in LESS than 100KB,
WHY can’t we get YouTube to load in under 1MB?”
1. https://en.wikipedia.org/wiki/.kkrieger
Mike Solomon
Early engineer at YouTube.
YouTube Feather
A hyper-light version of YouTube, back in 2010.
Constraints
• Start the video as fast as possible.
• Maintain >80% of the user experience.
• Use the latest technologies (circa 2010).
• Make as few requests as possible.
Results
• 98KB for “everything but the video”.
• 14 total requests from 3 domains.
• First production HTML5 video player.
• Opened up new regions around the world.
High latency environments are EVERYWHERE, even to this day.
A hyper-lightweight website is a RECONCEPTION of a web-based user interface
designed for the purposes of pushing the limits of performance.
Buildinga hyper-lightweightwebsite.
The goal is to provide an experience, roughly consistent with the real thing,
that can be delivered to an end user AS FAST AS POSSIBLE.
Steps to building a hyper-lightweight version of a website:
1. Identify the most active page on your website.
2. Build a new version of that page from scratch with a singular focus on optimization.
3. Assemble all of the HTML, CSS and Javascript into a single “hyper-light” HTML page.
4. Serve the hyper-light page behind a CDN with compression and HTTP/2 pipelining enabled.
5. Measure both the original page, uncached, and the hyper-light page.
6. Analyze the results.
Things you want to KEEP doing:
• Serve real content, preferably dynamically.
• Responsive layouts (at minimum, common breakpoints).
• Responsive images.
• Sprites, in some cases.
• SVG graphics (optimized responsibly).
• Accessibility.
Things you want to STOP doing: (for the purposes of this exercise)
• Ads and social media trackers.
• CMS integrations.
• Javascript libraries.
• CSS layouts via frameworks.
• Lazy loading content (except images).
• Data URIs, unless absolutely certain.
• Javascript and CSS compilation.
• Custom web fonts.
Areal worldexample.
Walking through an example
Original
Requests 181
Domains 50
Bandwidth
Total Content Size 8.7 MBs
Total Transfer Size 5.9 MBs
Non-Image Content 2.0 MBs
Image Content 3.9 MBs
Billed By CDN 4.9 MBs
Response Times
(First Paint —>
Fully Loaded)
2G 22 sec —-—> 2 min 47 sec
3G 6.4 sec ——> 53 sec
Hi-Speed 1.5 sec ——-> 16.7 sec
Hyper-Light
Walking through an example
Original
Original Hyper-Light
Requests 181
🥁
Domains 50
Bandwidth
Total Content Size 8.7 MBs
Total Transfer Size 5.9 MBs
Non-Image Content 2.0 MBs
Image Content 3.9 MBs
Billed By CDN 4.9 MBs
Response Times
(First Paint —>
Fully Loaded)
2G 22 sec —-—> 2 min 47 sec
3G 6.4 sec ——> 53 sec
Hi-Speed 1.5 sec ——-> 16.7 sec
Original Hyper-Light
Requests 181 32 -82.3%
Domains 50 2 -96.0%
Bandwidth
Total Content Size 8.7 MBs
Total Transfer Size 5.9 MBs
Non-Image Content 2.0 MBs
Image Content 3.9 MBs
Billed By CDN 4.9 MBs
Response Times
(First Paint —>
Fully Loaded)
2G 22 sec —-—> 2 min 47 sec
3G 6.4 sec ——> 53 sec
Hi-Speed 1.5 sec ——-> 16.7 sec
Original Hyper-Light
Requests 181 32 -82.3%
Domains 50 2 -96.0%
Bandwidth
Total Content Size 8.7 MBs 1.1 MBs -87.4%
Total Transfer Size 5.9 MBs 1.0 MBs -83.1%
Non-Image Content 2.0 MBs 19 KBs -99.1%
Image Content 3.9 MBs 999.4 KBs -74.4%
Billed By CDN 4.9 MBs 1.0 MBs -79.6%
Response Times
(First Paint —>
Fully Loaded)
2G 22 sec —-—> 2 min 47 sec
3G 6.4 sec ——> 53 sec
Hi-Speed 1.5 sec ——-> 16.7 sec
Original Hyper-Light
Requests 181 32 -82.3%
Domains 50 2 -96.0%
Bandwidth
Total Content Size 8.7 MBs 1.1 MBs -87.4%
Total Transfer Size 5.9 MBs 1.0 MBs -83.1%
Non-Image Content 2.0 MBs 19 KBs -99.1%
Image Content 3.9 MBs 999.4 KBs -74.4%
Billed By CDN 4.9 MBs 1.0 MBs -79.6%
Response Times
(First Paint —>
Fully Loaded)
2G 22 sec —-—> 2 min 47 sec 773 msec ——-> 11 sec 15.7x
3G 6.4 sec ——> 53 sec 556 msec ——> 3.7 sec 14.3x
Hi-Speed 1.5 sec ——-> 16.7 sec 435 msec ——> 621 msec 26.9x
Thetechniquesused.
Inline as much as possible server-side.
<!DOCTYPE html>
<html>
<head>
<title>Car and Driver</title>
<style type=“text/css”>
{% include “styles.css” %}
</style>
<script type=“application/javascript”>
{% include “main.js” %}
</script>
</head>
<body>
{% include “sprite.svg” %}
<div>Hello World</div>
</body>
</html>
Inline as much as possible server-side.
<!DOCTYPE html>
<html>
<head>
<title>Car and Driver</title>
<style type=“text/css”>
{% include “styles.css” %}
</style>
<script type=“application/javascript”>
{% include “main.js” %}
</script>
</head>
<body>
{% include “sprite.svg” %}
<div>Hello World</div>
</body>
</html>
Use HTML5 semantic elements.
<!DOCTYPE html>
<html>
<head>
<title>Car and Driver</title>
</head>
<body>
<header>
<nav></nav>
</header>
<section>
<aside>
</aside>
<article>
Hello World!
</article>
</section>
<footer>
</footer>
</body>
</html>
95%
of users
Use HTML5 semantic elements.
<!DOCTYPE html>
<html>
<head>
<title>Car and Driver</title>
</head>
<body>
<header>
<nav></nav>
</header>
<section>
<aside>
</aside>
<article>
Hello World!
</article>
</section>
<footer>
</footer>
</body>
</html>
Relative layout using root em sizing.
<style type=“text/css”>
html {
font-size: 16px; /* root ems */
}
h1 {
font-size: 2rem; /* 32 px */
}
img.splash {
width: 50rem; /* 800 px */
height: 40rem; /* 600 px */
}
</style>
Relative layout using root em sizing.
96%
of users
<style type=“text/css”>
html {
font-size: 16px; /* root ems */
}
h1 {
font-size: 2rem; /* 32 px */
}
img.splash {
width: 50rem; /* 800 px */
height: 40rem; /* 600 px */
}
</style>
CSS grids.
1. https://material.io/design/layout/responsive-layout-grid.html
<html>
<head>
<style type=“text/css”>
#body {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 20px;
align-items: top;
}
header {
grid-column: 1 / span 3;
}
article {
grid-column: 1 / span 2;
}
</style>
</head>
<body>
<header>Header</header>
<article>Content</article>
<aside>Side</aside>
</body>
</html>
Header
Side
Content
CSS grids.
1. https://material.io/design/layout/responsive-layout-grid.html
<html>
<head>
<style type=“text/css”>
#body {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 20px;
align-items: top;
}
header {
grid-column: 1 / span 3;
}
article {
grid-column: 1 / span 2;
}
</style>
</head>
<body>
<header>Header</header>
<article>Content</article>
<aside>Side</aside>
</body>
</html>
87%
of users
Header
Side
Content
<html>
<head>
<template id=“article-template”>
<article>
<h1>Title</h1>
<p>Description</p>
</article>
</template>
<script type=“text/javascript”>
function addArticle(title, description) {
var template = document.getElementById(“article-template”);
var clone = document.importNode(template.content, true);
/* Make changes to the clone’s DOM. */
document.getElementById(“articles”).appendChild(clone);
}
</script>
</head>
<body>
<section id=“articles”></section>
</body>
</html>
HTML templates.
<html>
<head>
<template id=“article-template”>
<article>
<h1>Title</h1>
<p>Description</p>
</article>
</template>
<script type=“text/javascript”>
function addArticle(title, description) {
var template = document.getElementById(“article-template”);
var clone = document.importNode(template.content, true);
/* Make changes to the clone’s DOM. */
document.getElementById(“articles”).appendChild(clone);
}
</script>
</head>
<body>
<section id=“articles”></section>
</body>
</html>
HTML templates.89%
of users
State transitions using the CSS :target selector
<style type=“text/css”>
#search-form { display: none; }
#search-form:target { display: block; }
</style>
…
<a href=“#search-form”>Show Search</a>
<form id=“search-form”>
<input type=“text” name=“search-query”>
<input type=“submit” value=“Search”>
<a href=“#”>Cancel</a>
</form>
<style type=“text/css”>
#search-form { display: none; }
#search-form:target { display: block; }
</style>
…
<a href=“#search-form”>Show Search</a>
<form id=“search-form”>
<input type=“text” name=“search-query”>
<input type=“submit” value=“Search”>
<a href=“#”>Cancel</a>
</form>
Fragment identifier changes WILL get added to the browser history.
⚠
State transitions using the CSS :target selector
96%
of users
<style type=“text/css”>
#search-form { display: none; }
#search-form:target { display: block; }
</style>
…
<a href=“#search-form”>Show Search</a>
<form id=“search-form”>
<input type=“text” name=“search-query”>
<input type=“submit” value=“Search”>
<a href=“#”>Cancel</a>
</form>
Fragment identifier changes WILL get added to the browser history.
⚠
State transitions using the CSS :target selector
Replacing SVG with HTML and CSS.
Original
2 x SVG arrow graphics = ~5KBs
Hyper-light
Angle quotes + border-radius = 1KB
<style type=“text/css”>
.arrow {
background-color: #4D80AB;
border-radius: 50%;
color: white;
font-weight: bold;
height: 1rem;
width: 1rem;
}
…
</style>
…
<a href=“#prev” class=“arrow”>&lasquo;</a>
<span class=“pages”><em>1</em> of <em>5</em></span>
<a href=“#next” class=“arrow”>&rasquo;</a>
93%
of users
Replacing SVG with HTML and CSS.
Original
2 x SVG arrow graphics = ~5KBs
Hyper-light
Angle quotes + border-radius = 1KB
<style type=“text/css”>
.arrow {
background-color: #4D80AB;
border-radius: 50%;
color: white;
font-weight: bold;
height: 1rem;
width: 1rem;
}
…
</style>
…
<a href=“#prev” class=“arrow”>&lasquo;</a>
<span class=“pages”><em>1</em> of <em>5</em></span>
<a href=“#next” class=“arrow”>&rasquo;</a>
Using an SVG sprite with fragment identifiers.
<svg xmlns="http://www.w3.org/2000/svg" style="display: none">
<symbol id="icon-comments" viewBox="380 0 20 20">
<title>Comments</title>
<path d=“M394.57,4.19H385a1.2,…” style=“fill: #1383b3;” />
</symbol>
…
</svg>
…
<svg><use xlink:href=“#icon-comments” /></svg>
1. https://css-tricks.com/svg-symbol-good-choice-icons/
91%
of users
Using an SVG sprite with fragment identifiers.
<svg xmlns="http://www.w3.org/2000/svg" style="display: none">
<symbol id="icon-comments" viewBox="380 0 20 20">
<title>Comments</title>
<path d=“M394.57,4.19H385a1.2,…” style=“fill: #1383b3;” />
</symbol>
…
</svg>
…
<svg><use xlink:href=“#icon-comments” /></svg>
1. https://css-tricks.com/svg-symbol-good-choice-icons/
Image-based sprites.
<style type=“text/css”>
.car-image {
background-image: url(/car-sprite.jpg);
background-size: 100%;
height: 60px;
width: 140px;
}
#sports-car.car-image {
background-position: -280px -120px;
}
</style>
<div id=“sports-car” class=“car-image”></div>
Image-based sprites.
In most cases, HTTP/2 pipelining is the better approach.
⚠
<style type=“text/css”>
.car-image {
background-image: url(/car-sprite.jpg);
background-size: 100%;
height: 60px;
width: 140px;
}
#sports-car.car-image {
background-position: -280px -120px;
}
</style>
<div id=“sports-car” class=“car-image”></div>
96%
of users
Image-based sprites.
In most cases, HTTP/2 pipelining is the better approach.
⚠
<style type=“text/css”>
.car-image {
background-image: url(/car-sprite.jpg);
background-size: 100%;
height: 60px;
width: 140px;
}
#sports-car.car-image {
background-position: -280px -120px;
}
</style>
<div id=“sports-car” class=“car-image”></div>
<img src=“https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress”
srcset=“https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress 1x,
https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress&dpr=2 2x”
width=“200” alt=“Honda”>
Responsive images using srcset.
<img src=“https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress”
srcset=“https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress 1x,
https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress&dpr=2 2x”
width=“200” alt=“Honda”>
Responsive images using srcset.
<img src=“https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress”
srcset=“https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress 1x,
https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress&dpr=2 2x”
width=“200” alt=“Honda”>
Responsive images using srcset.
<img src=“https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress”
srcset=“https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress 1x,
https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress&dpr=2 2x”
width=“200” alt=“Honda”>
Responsive images using srcset.
88%
of users
<img src=“https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress”
srcset=“https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress 1x,
https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress&dpr=2 2x”
width=“200” alt=“Honda”>
Responsive images using srcset.
GZIP compression.
# A simple nginx.conf with gzip turned on.
server {
listen 8080;
server_name localhost;
gzip on;
gzip_comp_level 9;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}
GZIP compression.
# A simple nginx.conf with gzip turned on.
server {
listen 8080;
server_name localhost;
gzip on;
gzip_comp_level 9;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}
Make sure to vary on Accept-Encoding in your caching layers.
⚠
99%
of users
GZIP compression.
# A simple nginx.conf with gzip turned on.
server {
listen 8080;
server_name localhost;
gzip on;
gzip_comp_level 9;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}
Make sure to vary on Accept-Encoding in your caching layers.
⚠
Experiment with Brotli.
tom@servo:/www$ cd /data/repos && git clone https://github.com/google/brotli.git
tom@servo:/www$ sudo ln -s /data/repos/brotli/python/bro.py /usr/local/bin/bro.py
tom@servo:/www$ bro.py -i index.html -o index.html.br
Experiment with Brotli.
tom@servo:/www$ cd /data/repos && git clone https://github.com/google/brotli.git
tom@servo:/www$ sudo ln -s /data/repos/brotli/python/bro.py /usr/local/bin/bro.py
tom@servo:/www$ bro.py -i index.html -o index.html.br
84%
of users
tom@servo:/www$ cd /data/repos && git clone https://github.com/google/brotli.git
tom@servo:/www$ sudo ln -s /data/repos/brotli/python/bro.py /usr/local/bin/bro.py
tom@servo:/www$ bro.py -i index.html -o index.html.br
Experiment with Brotli.
HTTP/2 pipelining.
HTTP/2 pipelining.
84%
of users HTTP/2 pipelining.
Takingmeasurementsand actingonthedata.
Measuring the results using Sitespeed.
tom@servo:/data$ docker run -v “$(pwd)”:/sitespeed.io 
> sitespeedio/sitespeed.io:7.3.6 https://www.caranddriver.com
Zeroing in on the biggest wins.
15 images requests
~600KBs
1 image request
~50KBs
Taking the next steps…
• Repeat the process with other pages.
• Run a 1% test in the wild.
• Build a performance budget.
• Run Sitespeed (or similar) regularly.
{
"browsertime.pageSummary": [{
"metric": "statistics.timings.firstPaint.median",
"max": 1500
}],
"pagexray.pageSummary": [{
"metric": "transferSize",
"max": 1000000
}, {
"metric": "requests",
"max": 45
}
}
1. https://www.sitespeed.io/documentation/sitespeed.io/performance-budget/
Source code:
https://github.com/zacman85/hyperlight-websites
Live demo:
http://hlw.chriszacharias.com
Special thanks to Miguel Cardona.
Thankyou!
Chris Zacharias
CEO, FOUNDER @
chris@imgix.com
@zacman85

Más contenido relacionado

La actualidad más candente

Caching the Uncacheable [Long Version]
Caching the Uncacheable [Long Version]Caching the Uncacheable [Long Version]
Caching the Uncacheable [Long Version]Fastly
 
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015Fastly
 
Rails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeRails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeMichael May
 
Tips for going fast in a slow world: Michael May at OSCON 2015
Tips for going fast in a slow world: Michael May at OSCON 2015Tips for going fast in a slow world: Michael May at OSCON 2015
Tips for going fast in a slow world: Michael May at OSCON 2015Fastly
 
Web Performance - Learnings from Velocity Conference
Web Performance - Learnings from Velocity ConferenceWeb Performance - Learnings from Velocity Conference
Web Performance - Learnings from Velocity ConferenceHardik Shah
 
ApacheConNA 2015: Apache httpd 2.4 Reverse Proxy
ApacheConNA 2015: Apache httpd 2.4 Reverse ProxyApacheConNA 2015: Apache httpd 2.4 Reverse Proxy
ApacheConNA 2015: Apache httpd 2.4 Reverse ProxyJim Jagielski
 
NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance CachingNGINX, Inc.
 
Apache HTTPD 2.4 Reverse Proxy: The Hidden Gem
Apache HTTPD 2.4 Reverse Proxy: The Hidden GemApache HTTPD 2.4 Reverse Proxy: The Hidden Gem
Apache HTTPD 2.4 Reverse Proxy: The Hidden GemJim Jagielski
 
Building a better web
Building a better webBuilding a better web
Building a better webFastly
 
Pagespeed what, why, and how it works
Pagespeed   what, why, and how it worksPagespeed   what, why, and how it works
Pagespeed what, why, and how it worksIlya Grigorik
 
Distributed automation sel_conf_2015
Distributed automation sel_conf_2015Distributed automation sel_conf_2015
Distributed automation sel_conf_2015aragavan
 
Care and feeding notes
Care and feeding notesCare and feeding notes
Care and feeding notesPerrin Harkins
 
Revisiting the Six Degrees Problem with a Graph Database - Nick Quinn
Revisiting the Six Degrees Problem with a Graph Database - Nick QuinnRevisiting the Six Degrees Problem with a Graph Database - Nick Quinn
Revisiting the Six Degrees Problem with a Graph Database - Nick Quinnjaxconf
 
Building your own CDN using Amazon EC2
Building your own CDN using Amazon EC2Building your own CDN using Amazon EC2
Building your own CDN using Amazon EC2SergeyChernyshev
 
Voices that matter: High Performance Web Sites
Voices that matter: High Performance Web SitesVoices that matter: High Performance Web Sites
Voices that matter: High Performance Web SitesStoyan Stefanov
 

La actualidad más candente (20)

Caching the Uncacheable [Long Version]
Caching the Uncacheable [Long Version]Caching the Uncacheable [Long Version]
Caching the Uncacheable [Long Version]
 
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
 
Rails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeRails Caching Secrets from the Edge
Rails Caching Secrets from the Edge
 
Tips for going fast in a slow world: Michael May at OSCON 2015
Tips for going fast in a slow world: Michael May at OSCON 2015Tips for going fast in a slow world: Michael May at OSCON 2015
Tips for going fast in a slow world: Michael May at OSCON 2015
 
Web Performance - Learnings from Velocity Conference
Web Performance - Learnings from Velocity ConferenceWeb Performance - Learnings from Velocity Conference
Web Performance - Learnings from Velocity Conference
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
ApacheConNA 2015: Apache httpd 2.4 Reverse Proxy
ApacheConNA 2015: Apache httpd 2.4 Reverse ProxyApacheConNA 2015: Apache httpd 2.4 Reverse Proxy
ApacheConNA 2015: Apache httpd 2.4 Reverse Proxy
 
Speed Matters
Speed MattersSpeed Matters
Speed Matters
 
Rebooting a Cloud
Rebooting a CloudRebooting a Cloud
Rebooting a Cloud
 
How Flipkart scales PHP
How Flipkart scales PHPHow Flipkart scales PHP
How Flipkart scales PHP
 
NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance Caching
 
Apache HTTPD 2.4 Reverse Proxy: The Hidden Gem
Apache HTTPD 2.4 Reverse Proxy: The Hidden GemApache HTTPD 2.4 Reverse Proxy: The Hidden Gem
Apache HTTPD 2.4 Reverse Proxy: The Hidden Gem
 
Building a better web
Building a better webBuilding a better web
Building a better web
 
Pagespeed what, why, and how it works
Pagespeed   what, why, and how it worksPagespeed   what, why, and how it works
Pagespeed what, why, and how it works
 
Distributed automation sel_conf_2015
Distributed automation sel_conf_2015Distributed automation sel_conf_2015
Distributed automation sel_conf_2015
 
Care and feeding notes
Care and feeding notesCare and feeding notes
Care and feeding notes
 
Revisiting the Six Degrees Problem with a Graph Database - Nick Quinn
Revisiting the Six Degrees Problem with a Graph Database - Nick QuinnRevisiting the Six Degrees Problem with a Graph Database - Nick Quinn
Revisiting the Six Degrees Problem with a Graph Database - Nick Quinn
 
Building your own CDN using Amazon EC2
Building your own CDN using Amazon EC2Building your own CDN using Amazon EC2
Building your own CDN using Amazon EC2
 
Voices that matter: High Performance Web Sites
Voices that matter: High Performance Web SitesVoices that matter: High Performance Web Sites
Voices that matter: High Performance Web Sites
 
Snappy servay
Snappy servaySnappy servay
Snappy servay
 

Similar a Hyper-Lightweight Websites

Hyperlight Websites - Chris Zacharias
Hyperlight Websites - Chris ZachariasHyperlight Websites - Chris Zacharias
Hyperlight Websites - Chris ZachariasChristopher Zacharias
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterDoris Chen
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ XeroCraig Walker
 
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站areyouok
 
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站topgeek
 
Html5 shubelal
Html5 shubelalHtml5 shubelal
Html5 shubelalShub
 
The Need for Speed - SMX Sydney 2013
The Need for Speed - SMX Sydney 2013The Need for Speed - SMX Sydney 2013
The Need for Speed - SMX Sydney 2013Bastian Grimm
 
High performance website
High performance websiteHigh performance website
High performance websiteChamnap Chhorn
 
A little journey into website optimization
A little journey into website optimizationA little journey into website optimization
A little journey into website optimizationStelian Firez
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsSiarhei Barysiuk
 
Website Performance
Website PerformanceWebsite Performance
Website PerformanceHugo Fonseca
 
Going on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceGoing on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceAdam Norwood
 
Csdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer YahooCsdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer Yahooguestb1b95b
 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster WebsitesCraig Walker
 
3 Tips for a better mobile User Experience
3 Tips for a better mobile User Experience3 Tips for a better mobile User Experience
3 Tips for a better mobile User ExperienceKlaus Enzenhofer
 
Front-End Web Performance Optimization by BucketSoft
Front-End Web Performance Optimization by BucketSoftFront-End Web Performance Optimization by BucketSoft
Front-End Web Performance Optimization by BucketSoftSteve Wortham
 

Similar a Hyper-Lightweight Websites (20)

Hyperlight Websites - Chris Zacharias
Hyperlight Websites - Chris ZachariasHyperlight Websites - Chris Zacharias
Hyperlight Websites - Chris Zacharias
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ Xero
 
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站
 
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站
 
Html5 shubelal
Html5 shubelalHtml5 shubelal
Html5 shubelal
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
The Need for Speed - SMX Sydney 2013
The Need for Speed - SMX Sydney 2013The Need for Speed - SMX Sydney 2013
The Need for Speed - SMX Sydney 2013
 
High performance website
High performance websiteHigh performance website
High performance website
 
A little journey into website optimization
A little journey into website optimizationA little journey into website optimization
A little journey into website optimization
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Website Performance
Website PerformanceWebsite Performance
Website Performance
 
Going on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceGoing on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web Performance
 
Csdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer YahooCsdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer Yahoo
 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design
 
Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster Websites
 
3 Tips for a better mobile User Experience
3 Tips for a better mobile User Experience3 Tips for a better mobile User Experience
3 Tips for a better mobile User Experience
 
Front-End Web Performance Optimization by BucketSoft
Front-End Web Performance Optimization by BucketSoftFront-End Web Performance Optimization by BucketSoft
Front-End Web Performance Optimization by BucketSoft
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 
Looking into HTML5 + CSS3
Looking into HTML5 + CSS3Looking into HTML5 + CSS3
Looking into HTML5 + CSS3
 

Más de FITC

Cut it up
Cut it upCut it up
Cut it upFITC
 
Designing for Digital Health
Designing for Digital HealthDesigning for Digital Health
Designing for Digital HealthFITC
 
Surviving Your Tech Stack
Surviving Your Tech StackSurviving Your Tech Stack
Surviving Your Tech StackFITC
 
How to Pitch Your First AR Project
How to Pitch Your First AR ProjectHow to Pitch Your First AR Project
How to Pitch Your First AR ProjectFITC
 
Start by Understanding the Problem, Not by Delivering the Answer
Start by Understanding the Problem, Not by Delivering the AnswerStart by Understanding the Problem, Not by Delivering the Answer
Start by Understanding the Problem, Not by Delivering the AnswerFITC
 
Cocaine to Carrots: The Art of Telling Someone Else’s Story
Cocaine to Carrots: The Art of Telling Someone Else’s StoryCocaine to Carrots: The Art of Telling Someone Else’s Story
Cocaine to Carrots: The Art of Telling Someone Else’s StoryFITC
 
Everyday Innovation
Everyday InnovationEveryday Innovation
Everyday InnovationFITC
 
Everything is Terrifying
Everything is TerrifyingEverything is Terrifying
Everything is TerrifyingFITC
 
Post-Earth Visions: Designing for Space and the Future Human
Post-Earth Visions: Designing for Space and the Future HumanPost-Earth Visions: Designing for Space and the Future Human
Post-Earth Visions: Designing for Space and the Future HumanFITC
 
The Rise of the Creative Social Influencer (and How to Become One)
The Rise of the Creative Social Influencer (and How to Become One)The Rise of the Creative Social Influencer (and How to Become One)
The Rise of the Creative Social Influencer (and How to Become One)FITC
 
East of the Rockies: Developing an AR Game
East of the Rockies: Developing an AR GameEast of the Rockies: Developing an AR Game
East of the Rockies: Developing an AR GameFITC
 
Creating a Proactive Healthcare System
Creating a Proactive Healthcare SystemCreating a Proactive Healthcare System
Creating a Proactive Healthcare SystemFITC
 
World Transformation: The Secret Agenda of Product Design
World Transformation: The Secret Agenda of Product DesignWorld Transformation: The Secret Agenda of Product Design
World Transformation: The Secret Agenda of Product DesignFITC
 
The Power of Now
The Power of NowThe Power of Now
The Power of NowFITC
 
High Performance PWAs
High Performance PWAsHigh Performance PWAs
High Performance PWAsFITC
 
Rise of the JAMstack
Rise of the JAMstackRise of the JAMstack
Rise of the JAMstackFITC
 
From Closed to Open: A Journey of Self Discovery
From Closed to Open: A Journey of Self DiscoveryFrom Closed to Open: A Journey of Self Discovery
From Closed to Open: A Journey of Self DiscoveryFITC
 
Projects Ain’t Nobody Got Time For
Projects Ain’t Nobody Got Time ForProjects Ain’t Nobody Got Time For
Projects Ain’t Nobody Got Time ForFITC
 
The Art of Being Bad
The Art of Being BadThe Art of Being Bad
The Art of Being BadFITC
 
The Making of Freeroam VR
The Making of Freeroam VRThe Making of Freeroam VR
The Making of Freeroam VRFITC
 

Más de FITC (20)

Cut it up
Cut it upCut it up
Cut it up
 
Designing for Digital Health
Designing for Digital HealthDesigning for Digital Health
Designing for Digital Health
 
Surviving Your Tech Stack
Surviving Your Tech StackSurviving Your Tech Stack
Surviving Your Tech Stack
 
How to Pitch Your First AR Project
How to Pitch Your First AR ProjectHow to Pitch Your First AR Project
How to Pitch Your First AR Project
 
Start by Understanding the Problem, Not by Delivering the Answer
Start by Understanding the Problem, Not by Delivering the AnswerStart by Understanding the Problem, Not by Delivering the Answer
Start by Understanding the Problem, Not by Delivering the Answer
 
Cocaine to Carrots: The Art of Telling Someone Else’s Story
Cocaine to Carrots: The Art of Telling Someone Else’s StoryCocaine to Carrots: The Art of Telling Someone Else’s Story
Cocaine to Carrots: The Art of Telling Someone Else’s Story
 
Everyday Innovation
Everyday InnovationEveryday Innovation
Everyday Innovation
 
Everything is Terrifying
Everything is TerrifyingEverything is Terrifying
Everything is Terrifying
 
Post-Earth Visions: Designing for Space and the Future Human
Post-Earth Visions: Designing for Space and the Future HumanPost-Earth Visions: Designing for Space and the Future Human
Post-Earth Visions: Designing for Space and the Future Human
 
The Rise of the Creative Social Influencer (and How to Become One)
The Rise of the Creative Social Influencer (and How to Become One)The Rise of the Creative Social Influencer (and How to Become One)
The Rise of the Creative Social Influencer (and How to Become One)
 
East of the Rockies: Developing an AR Game
East of the Rockies: Developing an AR GameEast of the Rockies: Developing an AR Game
East of the Rockies: Developing an AR Game
 
Creating a Proactive Healthcare System
Creating a Proactive Healthcare SystemCreating a Proactive Healthcare System
Creating a Proactive Healthcare System
 
World Transformation: The Secret Agenda of Product Design
World Transformation: The Secret Agenda of Product DesignWorld Transformation: The Secret Agenda of Product Design
World Transformation: The Secret Agenda of Product Design
 
The Power of Now
The Power of NowThe Power of Now
The Power of Now
 
High Performance PWAs
High Performance PWAsHigh Performance PWAs
High Performance PWAs
 
Rise of the JAMstack
Rise of the JAMstackRise of the JAMstack
Rise of the JAMstack
 
From Closed to Open: A Journey of Self Discovery
From Closed to Open: A Journey of Self DiscoveryFrom Closed to Open: A Journey of Self Discovery
From Closed to Open: A Journey of Self Discovery
 
Projects Ain’t Nobody Got Time For
Projects Ain’t Nobody Got Time ForProjects Ain’t Nobody Got Time For
Projects Ain’t Nobody Got Time For
 
The Art of Being Bad
The Art of Being BadThe Art of Being Bad
The Art of Being Bad
 
The Making of Freeroam VR
The Making of Freeroam VRThe Making of Freeroam VR
The Making of Freeroam VR
 

Último

定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationMarko4394
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleanscorenetworkseo
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 

Último (20)

定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentation
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleans
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 

Hyper-Lightweight Websites

  • 1. Chris Zacharias Hyper-LightweightWebsites CEO, FOUNDER @ chris@imgix.com @zacman85 Web Unleashed - Toronto October 2, 2018
  • 2. “If they can build an entire Quake clone1 in LESS than 100KB, WHY can’t we get YouTube to load in under 1MB?” 1. https://en.wikipedia.org/wiki/.kkrieger Mike Solomon Early engineer at YouTube.
  • 3. YouTube Feather A hyper-light version of YouTube, back in 2010. Constraints • Start the video as fast as possible. • Maintain >80% of the user experience. • Use the latest technologies (circa 2010). • Make as few requests as possible.
  • 4. Results • 98KB for “everything but the video”. • 14 total requests from 3 domains. • First production HTML5 video player. • Opened up new regions around the world.
  • 5. High latency environments are EVERYWHERE, even to this day.
  • 6.
  • 7. A hyper-lightweight website is a RECONCEPTION of a web-based user interface designed for the purposes of pushing the limits of performance.
  • 8.
  • 9.
  • 11. The goal is to provide an experience, roughly consistent with the real thing, that can be delivered to an end user AS FAST AS POSSIBLE.
  • 12. Steps to building a hyper-lightweight version of a website: 1. Identify the most active page on your website. 2. Build a new version of that page from scratch with a singular focus on optimization. 3. Assemble all of the HTML, CSS and Javascript into a single “hyper-light” HTML page. 4. Serve the hyper-light page behind a CDN with compression and HTTP/2 pipelining enabled. 5. Measure both the original page, uncached, and the hyper-light page. 6. Analyze the results.
  • 13. Things you want to KEEP doing: • Serve real content, preferably dynamically. • Responsive layouts (at minimum, common breakpoints). • Responsive images. • Sprites, in some cases. • SVG graphics (optimized responsibly). • Accessibility.
  • 14. Things you want to STOP doing: (for the purposes of this exercise) • Ads and social media trackers. • CMS integrations. • Javascript libraries. • CSS layouts via frameworks. • Lazy loading content (except images). • Data URIs, unless absolutely certain. • Javascript and CSS compilation. • Custom web fonts.
  • 17. Original Requests 181 Domains 50 Bandwidth Total Content Size 8.7 MBs Total Transfer Size 5.9 MBs Non-Image Content 2.0 MBs Image Content 3.9 MBs Billed By CDN 4.9 MBs Response Times (First Paint —> Fully Loaded) 2G 22 sec —-—> 2 min 47 sec 3G 6.4 sec ——> 53 sec Hi-Speed 1.5 sec ——-> 16.7 sec
  • 19. Walking through an example Original
  • 20. Original Hyper-Light Requests 181 🥁 Domains 50 Bandwidth Total Content Size 8.7 MBs Total Transfer Size 5.9 MBs Non-Image Content 2.0 MBs Image Content 3.9 MBs Billed By CDN 4.9 MBs Response Times (First Paint —> Fully Loaded) 2G 22 sec —-—> 2 min 47 sec 3G 6.4 sec ——> 53 sec Hi-Speed 1.5 sec ——-> 16.7 sec
  • 21. Original Hyper-Light Requests 181 32 -82.3% Domains 50 2 -96.0% Bandwidth Total Content Size 8.7 MBs Total Transfer Size 5.9 MBs Non-Image Content 2.0 MBs Image Content 3.9 MBs Billed By CDN 4.9 MBs Response Times (First Paint —> Fully Loaded) 2G 22 sec —-—> 2 min 47 sec 3G 6.4 sec ——> 53 sec Hi-Speed 1.5 sec ——-> 16.7 sec
  • 22. Original Hyper-Light Requests 181 32 -82.3% Domains 50 2 -96.0% Bandwidth Total Content Size 8.7 MBs 1.1 MBs -87.4% Total Transfer Size 5.9 MBs 1.0 MBs -83.1% Non-Image Content 2.0 MBs 19 KBs -99.1% Image Content 3.9 MBs 999.4 KBs -74.4% Billed By CDN 4.9 MBs 1.0 MBs -79.6% Response Times (First Paint —> Fully Loaded) 2G 22 sec —-—> 2 min 47 sec 3G 6.4 sec ——> 53 sec Hi-Speed 1.5 sec ——-> 16.7 sec
  • 23. Original Hyper-Light Requests 181 32 -82.3% Domains 50 2 -96.0% Bandwidth Total Content Size 8.7 MBs 1.1 MBs -87.4% Total Transfer Size 5.9 MBs 1.0 MBs -83.1% Non-Image Content 2.0 MBs 19 KBs -99.1% Image Content 3.9 MBs 999.4 KBs -74.4% Billed By CDN 4.9 MBs 1.0 MBs -79.6% Response Times (First Paint —> Fully Loaded) 2G 22 sec —-—> 2 min 47 sec 773 msec ——-> 11 sec 15.7x 3G 6.4 sec ——> 53 sec 556 msec ——> 3.7 sec 14.3x Hi-Speed 1.5 sec ——-> 16.7 sec 435 msec ——> 621 msec 26.9x
  • 25. Inline as much as possible server-side. <!DOCTYPE html> <html> <head> <title>Car and Driver</title> <style type=“text/css”> {% include “styles.css” %} </style> <script type=“application/javascript”> {% include “main.js” %} </script> </head> <body> {% include “sprite.svg” %} <div>Hello World</div> </body> </html>
  • 26. Inline as much as possible server-side. <!DOCTYPE html> <html> <head> <title>Car and Driver</title> <style type=“text/css”> {% include “styles.css” %} </style> <script type=“application/javascript”> {% include “main.js” %} </script> </head> <body> {% include “sprite.svg” %} <div>Hello World</div> </body> </html>
  • 27. Use HTML5 semantic elements. <!DOCTYPE html> <html> <head> <title>Car and Driver</title> </head> <body> <header> <nav></nav> </header> <section> <aside> </aside> <article> Hello World! </article> </section> <footer> </footer> </body> </html>
  • 28. 95% of users Use HTML5 semantic elements. <!DOCTYPE html> <html> <head> <title>Car and Driver</title> </head> <body> <header> <nav></nav> </header> <section> <aside> </aside> <article> Hello World! </article> </section> <footer> </footer> </body> </html>
  • 29. Relative layout using root em sizing. <style type=“text/css”> html { font-size: 16px; /* root ems */ } h1 { font-size: 2rem; /* 32 px */ } img.splash { width: 50rem; /* 800 px */ height: 40rem; /* 600 px */ } </style>
  • 30. Relative layout using root em sizing. 96% of users <style type=“text/css”> html { font-size: 16px; /* root ems */ } h1 { font-size: 2rem; /* 32 px */ } img.splash { width: 50rem; /* 800 px */ height: 40rem; /* 600 px */ } </style>
  • 31. CSS grids. 1. https://material.io/design/layout/responsive-layout-grid.html <html> <head> <style type=“text/css”> #body { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 20px; align-items: top; } header { grid-column: 1 / span 3; } article { grid-column: 1 / span 2; } </style> </head> <body> <header>Header</header> <article>Content</article> <aside>Side</aside> </body> </html> Header Side Content
  • 32. CSS grids. 1. https://material.io/design/layout/responsive-layout-grid.html <html> <head> <style type=“text/css”> #body { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 20px; align-items: top; } header { grid-column: 1 / span 3; } article { grid-column: 1 / span 2; } </style> </head> <body> <header>Header</header> <article>Content</article> <aside>Side</aside> </body> </html> 87% of users Header Side Content
  • 33. <html> <head> <template id=“article-template”> <article> <h1>Title</h1> <p>Description</p> </article> </template> <script type=“text/javascript”> function addArticle(title, description) { var template = document.getElementById(“article-template”); var clone = document.importNode(template.content, true); /* Make changes to the clone’s DOM. */ document.getElementById(“articles”).appendChild(clone); } </script> </head> <body> <section id=“articles”></section> </body> </html> HTML templates.
  • 34. <html> <head> <template id=“article-template”> <article> <h1>Title</h1> <p>Description</p> </article> </template> <script type=“text/javascript”> function addArticle(title, description) { var template = document.getElementById(“article-template”); var clone = document.importNode(template.content, true); /* Make changes to the clone’s DOM. */ document.getElementById(“articles”).appendChild(clone); } </script> </head> <body> <section id=“articles”></section> </body> </html> HTML templates.89% of users
  • 35. State transitions using the CSS :target selector <style type=“text/css”> #search-form { display: none; } #search-form:target { display: block; } </style> … <a href=“#search-form”>Show Search</a> <form id=“search-form”> <input type=“text” name=“search-query”> <input type=“submit” value=“Search”> <a href=“#”>Cancel</a> </form>
  • 36. <style type=“text/css”> #search-form { display: none; } #search-form:target { display: block; } </style> … <a href=“#search-form”>Show Search</a> <form id=“search-form”> <input type=“text” name=“search-query”> <input type=“submit” value=“Search”> <a href=“#”>Cancel</a> </form> Fragment identifier changes WILL get added to the browser history. ⚠ State transitions using the CSS :target selector
  • 37. 96% of users <style type=“text/css”> #search-form { display: none; } #search-form:target { display: block; } </style> … <a href=“#search-form”>Show Search</a> <form id=“search-form”> <input type=“text” name=“search-query”> <input type=“submit” value=“Search”> <a href=“#”>Cancel</a> </form> Fragment identifier changes WILL get added to the browser history. ⚠ State transitions using the CSS :target selector
  • 38. Replacing SVG with HTML and CSS. Original 2 x SVG arrow graphics = ~5KBs Hyper-light Angle quotes + border-radius = 1KB <style type=“text/css”> .arrow { background-color: #4D80AB; border-radius: 50%; color: white; font-weight: bold; height: 1rem; width: 1rem; } … </style> … <a href=“#prev” class=“arrow”>&lasquo;</a> <span class=“pages”><em>1</em> of <em>5</em></span> <a href=“#next” class=“arrow”>&rasquo;</a>
  • 39. 93% of users Replacing SVG with HTML and CSS. Original 2 x SVG arrow graphics = ~5KBs Hyper-light Angle quotes + border-radius = 1KB <style type=“text/css”> .arrow { background-color: #4D80AB; border-radius: 50%; color: white; font-weight: bold; height: 1rem; width: 1rem; } … </style> … <a href=“#prev” class=“arrow”>&lasquo;</a> <span class=“pages”><em>1</em> of <em>5</em></span> <a href=“#next” class=“arrow”>&rasquo;</a>
  • 40. Using an SVG sprite with fragment identifiers. <svg xmlns="http://www.w3.org/2000/svg" style="display: none"> <symbol id="icon-comments" viewBox="380 0 20 20"> <title>Comments</title> <path d=“M394.57,4.19H385a1.2,…” style=“fill: #1383b3;” /> </symbol> … </svg> … <svg><use xlink:href=“#icon-comments” /></svg> 1. https://css-tricks.com/svg-symbol-good-choice-icons/
  • 41. 91% of users Using an SVG sprite with fragment identifiers. <svg xmlns="http://www.w3.org/2000/svg" style="display: none"> <symbol id="icon-comments" viewBox="380 0 20 20"> <title>Comments</title> <path d=“M394.57,4.19H385a1.2,…” style=“fill: #1383b3;” /> </symbol> … </svg> … <svg><use xlink:href=“#icon-comments” /></svg> 1. https://css-tricks.com/svg-symbol-good-choice-icons/
  • 42. Image-based sprites. <style type=“text/css”> .car-image { background-image: url(/car-sprite.jpg); background-size: 100%; height: 60px; width: 140px; } #sports-car.car-image { background-position: -280px -120px; } </style> <div id=“sports-car” class=“car-image”></div>
  • 43. Image-based sprites. In most cases, HTTP/2 pipelining is the better approach. ⚠ <style type=“text/css”> .car-image { background-image: url(/car-sprite.jpg); background-size: 100%; height: 60px; width: 140px; } #sports-car.car-image { background-position: -280px -120px; } </style> <div id=“sports-car” class=“car-image”></div>
  • 44. 96% of users Image-based sprites. In most cases, HTTP/2 pipelining is the better approach. ⚠ <style type=“text/css”> .car-image { background-image: url(/car-sprite.jpg); background-size: 100%; height: 60px; width: 140px; } #sports-car.car-image { background-position: -280px -120px; } </style> <div id=“sports-car” class=“car-image”></div>
  • 49. 88% of users <img src=“https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress” srcset=“https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress 1x, https://cnd.imgix.net/images/honda.jpg?w=200&fm=pjpg&auto=format,compress&dpr=2 2x” width=“200” alt=“Honda”> Responsive images using srcset.
  • 50. GZIP compression. # A simple nginx.conf with gzip turned on. server { listen 8080; server_name localhost; gzip on; gzip_comp_level 9; location / { root /usr/share/nginx/html; index index.html index.htm; } }
  • 51. GZIP compression. # A simple nginx.conf with gzip turned on. server { listen 8080; server_name localhost; gzip on; gzip_comp_level 9; location / { root /usr/share/nginx/html; index index.html index.htm; } } Make sure to vary on Accept-Encoding in your caching layers. ⚠
  • 52. 99% of users GZIP compression. # A simple nginx.conf with gzip turned on. server { listen 8080; server_name localhost; gzip on; gzip_comp_level 9; location / { root /usr/share/nginx/html; index index.html index.htm; } } Make sure to vary on Accept-Encoding in your caching layers. ⚠
  • 53. Experiment with Brotli. tom@servo:/www$ cd /data/repos && git clone https://github.com/google/brotli.git tom@servo:/www$ sudo ln -s /data/repos/brotli/python/bro.py /usr/local/bin/bro.py tom@servo:/www$ bro.py -i index.html -o index.html.br
  • 54. Experiment with Brotli. tom@servo:/www$ cd /data/repos && git clone https://github.com/google/brotli.git tom@servo:/www$ sudo ln -s /data/repos/brotli/python/bro.py /usr/local/bin/bro.py tom@servo:/www$ bro.py -i index.html -o index.html.br
  • 55. 84% of users tom@servo:/www$ cd /data/repos && git clone https://github.com/google/brotli.git tom@servo:/www$ sudo ln -s /data/repos/brotli/python/bro.py /usr/local/bin/bro.py tom@servo:/www$ bro.py -i index.html -o index.html.br Experiment with Brotli.
  • 58. 84% of users HTTP/2 pipelining.
  • 60. Measuring the results using Sitespeed. tom@servo:/data$ docker run -v “$(pwd)”:/sitespeed.io > sitespeedio/sitespeed.io:7.3.6 https://www.caranddriver.com
  • 61. Zeroing in on the biggest wins. 15 images requests ~600KBs 1 image request ~50KBs
  • 62. Taking the next steps… • Repeat the process with other pages. • Run a 1% test in the wild. • Build a performance budget. • Run Sitespeed (or similar) regularly. { "browsertime.pageSummary": [{ "metric": "statistics.timings.firstPaint.median", "max": 1500 }], "pagexray.pageSummary": [{ "metric": "transferSize", "max": 1000000 }, { "metric": "requests", "max": 45 } } 1. https://www.sitespeed.io/documentation/sitespeed.io/performance-budget/
  • 63. Source code: https://github.com/zacman85/hyperlight-websites Live demo: http://hlw.chriszacharias.com Special thanks to Miguel Cardona. Thankyou! Chris Zacharias CEO, FOUNDER @ chris@imgix.com @zacman85