Emily Grossman's talk about PWAs from BrightonSEO September 2017
Video slides have been replaced by a screenshot with links to the videos or their original sources.
7. #BrightonSEO @goutaste
PWAs = Death to the Dino
(Someone else made this illustra:on, and I photographed it. Now I cannot remember who. SORRY.)
8. #BrightonSEO @goutaste
Why Do People Like PWAs?
Mobile sales increased by 18% YoY
43% increase in sessions/ user
100% increase in session dura:on 80% improvement in load :me
30% higher Conversion Rate than
na:ve app in Tier 3 ci:es
20% of PWA bookings are from
users who’d uninstalled na:ve app
Homepage loads completely in .8
seconds
Customer acquisi:on cost is 10X less Shoppers spend 20% more ?me
than on previous mobile site
40% lower bounce rate than on
previous mobile site
hEps://www.pwastats.com/
30. #BrightonSEO @goutaste
1. Speed & Performance
Set UpYour Service Worker to
Cache Essential Assets
document.querySelector('.cache-article').addEventListener('click', function(event) {
event.preventDefault();
var id = this.dataset.articleId;
caches.open('mysite-article-' + id).then(function(cache) {
fetch('/get-article-urls?id=' + id).then(function(response) {
// /get-article-urls returns a JSON-encoded array of
// resource URLs that a given article depends on
return response.json();
}).then(function(urls) {
cache.addAll(urls);
});
});
});
On user interaction…
(ex.“save for offline” button)
hEp://bit.ly/sw-caching
32. #BrightonSEO @goutaste
1. Speed & Performance
Optimize for Fast First Paint
Pre-load is like saying, “Hey, browser! Here’s a resource you’re going to need later on, so start loading it now.”
• Pre-load can specify the download “as” =
• "script",
• "style",
• "image",
• "media",
• "document”
bit.ly/what-is-rel-preload
HTTP/2 + Preload = Moves the ‘start download’ time of a critical asset closer to initial request
35. #BrightonSEO @goutaste
One of the
Issues With
Server-Side
Rendering is
The Trade-
Off With
Time to
Interactive
Simulated Slow Network hEps://youtu.be/6Ljq-Jn-EgU
VIDEO: hEps://youtu.be/6Ljq-Jn-EgU
43. #BrightonSEO @goutaste
1. Speed & Performance
“React As Soon As User Indicates Intent”
Cut Down on Click Latency
Experiment by Eli Fitch: Track your reac7on 7me on ‘mousedown’ vs. ‘click ’ hNp://bit.ly/eli-fitch-fluent
let startTime;
$('.button--onclick').on('mousedown', startTimer);
$('.button--onclick').on('click', endTimer);
function startTimer() {
startTime = Date.now();
}
function endTimer() {
const nowish = Date.now();
const timey = nowish - startTime;
$('.readout').html(`Mousedown fired <span class="bold">${timey}ms</span> before click
event`);
}
62. #BrightonSEO @goutaste
H/2 Push
Is Also
Better
With
Service
Workers
Initial Load with H/2 Push:
Repeat Load with all /push assets coming from the SW cache:
More on combining H/2 Push & SWs: hEps://24ways.org/2016/hEp2-server-push-and-service-workers/
Bonus Slide:
starter-pack
reading on H/2
push with
PWAs
More on H/2 Push & cache management: hEps://jakearchibald.com/2017/h2-push-tougher-than-i-thought/