SlideShare una empresa de Scribd logo
1 de 47
Instant Mobile Web: An AMP Primer
Lisa Huang

Nov 2017

Slides: bit.ly/nodevember

Twitter/Github: @lisaychuang
INSTANT MOBILE WEB: AN AMP PRIMER
Hello Nodevember!
▸ Financial analyst > Digital Marketer > Fullstack
Engineer
▸ Flatiron School alumnae
▸ Taiwan + Singapore + South Africa + USA
▸ Basic Android phone & buying data by MBs
▸ Discovered AMP project through a SEO course
on FrontEndMasters.com
INSTANT MOBILE WEB: AN AMP PRIMER
Shift Towards Mobile
▸ Oct 2016 - Mobile page views has
overtaken Desktop for the first time
globally
▸ March 2017 - Android device page
views has overtaken Windows
▸ Momentum in this direction is only
growing!
MOBILE: 48.3%
DESKTOP: 46.9%
45.6%
50%50%
WINDOWS: 38.8%
ANDROID: 39.2% 40.3%
50%
37.8%
http://gs.statcounter.com/os-market-share/desktop-mobile/worldwide/#monthly-201606-201711
http://gs.statcounter.com/platform-market-share/desktop-mobile-tablet/worldwide/#monthly-201606-201711
INSTANT MOBILE WEB: AN AMP PRIMER
Performance === 💰💸
➡ wpostats.com ⬅
▸ Google: +800ms page load time = -$1M daily revenue loss
▸ Financial Times: +3000ms load time = 7.2% drop in user engagement
▸ Walmart: -1000ms load time = +2% increase in conversion
▸ AliExpress: -36% load time = +10.5% increase in orders
INSTANT MOBILE WEB: AN AMP PRIMER
▸ AMP is an open source framework to build really fast
mobile pages
▸ Create instantly loading mobile pages
▸ 4 Billion+ pages, 25million+ domains, 100+ languages
▸ May 2017: Google mobile search AMP Top Stories
Carousel global rollout
https://www.ampproject.org/
https://techcrunch.com/2016/02/24/google-now-highlights-amp-pages-in-its-mobile-search-results/
INSTANT MOBILE WEB: AN AMP PRIMER
Content Platforms that enable AMP
https://www.ampproject.org/support/faqs/supported-platforms
▸ Facebook
▸ Twitter
▸ WordPress
▸ Google
▸ Medium
▸ Pinterest
▸ LinkedIn
▸ Reddit
▸ Nuzzel
▸ Hatena
▸ Squarespace
▸ Ghost
▸ Drupal
▸ Fastcommerce
▸ Canvas
https://www.ampproject.org/latest/blog/amp-two-years-of-user-first-webpages/
INSTANT MOBILE WEB: AN AMP PRIMER
Content Platforms AMP Works On
https://www.ampproject.org/support/faqs/supported-platforms
▸ Facebook
▸ Twitter
▸ WordPress
▸ Google
▸ Medium
▸ Pinterest
▸ LinkedIn
▸ Reddit
▸ Nuzzel
▸ Hatena
▸ Squarespace
▸ Ghost
▸ Drupal
▸ Fastcommerce
▸ Canvas
https://www.ampproject.org/latest/blog/amp-two-years-of-user-first-webpages/
INSTANT MOBILE WEB: AN AMP PRIMER
Content Platforms AMP Works On
https://www.ampproject.org/support/faqs/supported-platforms
▸ Facebook
▸ Twitter
▸ WordPress
▸ Google
▸ Medium
▸ Pinterest
▸ LinkedIn
▸ Reddit
▸ Nuzzel
▸ Hatena
▸ Squarespace
▸ Ghost
▸ Drupal
▸ Fastcommerce
▸ Canvas
https://www.ampproject.org/latest/blog/amp-two-years-of-user-first-webpages/
INSTANT MOBILE WEB: AN AMP PRIMER
Who is publishing with AMP Today?
https://www.ampproject.org/latest/blog/amp-two-years-of-user-first-webpages/
INSTANT MOBILE WEB: AN AMP PRIMER
Google I/O May 2017 announcements
▸ Before: focused on static content
▸ Now: interactive content, moving towards an
interactive framework
▸ Future: ecommerce, highly interactive
experiences
▸ AMP to PWA!
https://www.ampproject.org/docs/guides/pwa-amp
INSTANT MOBILE WEB: AN AMP PRIMER
Mobile Web Challenges
📱 Most devices are not powerful
📡 Cellular networks make connections slowly
' JS is usually doing all the heavy lifting
INSTANT MOBILE WEB: AN AMP PRIMER
📱 Challenge #1: Most devices are not powerful
INSTANT MOBILE WEB: AN AMP PRIMER
▸ Complex CSS animations
▸ Video viewing
▸ Data download & processing
▸ Background Processes (Web Worker)
▸ Push notifications
▸ GPS
▸ Sensors: accelerometer, gyroscope,
magnetometer requests
https://developer.apple.com/library/content/documentation/Perf
🐢 Underpowered Devices - What’s slow?
INSTANT MOBILE WEB: AN AMP PRIMER
Case Study: CSS Animations
▸ Animate the ball by iteratively setting the left
position
▸ Triggers re-layout calculations, “janky” animation
▸ This experience is never desirable!
INSTANT MOBILE WEB: AN AMP PRIMER
Case Study: CSS Animations
▸ Animate the ball using transform:
translateX()
▸ GPU optimized and does not trigger a re-layout
▸ Only re-composition is required
INSTANT MOBILE WEB: AN AMP PRIMER
Underpowered Devices - AMP approach: Subset CSS
▸ Only subset of CSS allowed
▸ Max. 50KB total CSS
▸ Animation: only GPU-accelerated properties allowed
▸ Use transform and opacity changes
https://developers.google.com/web/fundamentals/performance/rendering/stick-to-compositor-only-properties-and-manage-layer-count
➡ https://csstriggers.com/ ⬅
INSTANT MOBILE WEB: AN AMP PRIMER
Underpowered Devices: AMP custom components
▸ Pre-calculate initial viewport layout with <amp-img>
▸ specified fixed height & width
▸ includes placeholder, and a fallback
https://www.ampproject.org/docs/
INSTANT MOBILE WEB: AN AMP PRIMER
📡 Challenge #2: Cellular networks make connections slowly
▸ Slow to initiate network connection
▸ Mobile network requests are extra expensive, and involve extra latency
▸ 2G: 300 - 1000ms, 3G: 100 - 300ms extra, 4G: 10 - 100ms extra
https://developers.google.com/speed/docs/insights/mobile
INSTANT MOBILE WEB: AN AMP PRIMER
Cellular: What’s slow?
📱
🖥
50% of pages involve > 76 requests
Tested From: Dulles, VA, “Good 2G speed”
Chrome - Emulated Motorola G (Gen 4)📱 webpagetest.org
Case Study: Adobe Typekit Blog
INSTANT MOBILE WEB: AN AMP PRIMER
AMP approach: Inlined CSS
▸ Inlined CSS stylesheet!
▸ When HTML lands —> Mobile page is ready for basic use!
https://medium.com/@cramforce/why-amp-html-does-not-take-full-advantage-of-the-preload-scanner-7e7f788aa94e
HTML
CSS
JSSingle Page App
🌟
HTML CSS
JS
AMP Html
🌟
<style amp-custom="">##...#</style>
INSTANT MOBILE WEB: AN AMP PRIMER
AMP approach: Prioritize resource loading
▸ Control network requests to prioritize resources effectively
▸ Prefetches and lazy-loads resources:
▸ Resources are prefetched as early as possible (⬇ the fold), but...
▸ lazy-loaded as late as possible (CPU is only used when resources are
actually shown to users)
https://medium.com/@cramforce/why-amp-html-does-not-take-full-advantage-of-the-preload-scanner-7e7f788aa94e
INSTANT MOBILE WEB: AN AMP PRIMER
AMP approach: AMP Cache
▸ AMP pages will be cached
when they’re discovered (or
updates are found)

▸ This saves the overhead of DNS
resolution & SSL handshake
https://developers.google.com/amp/cache/overview
https://blog.cloudflare.com/accelerated-mobile/
INSTANT MOBILE WEB: AN AMP PRIMER
' Challenge #3: JS doing all the heavy lifting
INSTANT MOBILE WEB: AN AMP PRIMER
Heavy JS: What’s slow?
▸ Synchronous JS pauses HTML parsing, it resumes once download completes
▸ Parsing the downloaded JS takes time (related to code size & other factors)
▸ ⚠ Server-side rendering aims to help, but is incredibly complex to get right
https://developer.apple.com/library/content/documentation/Performance/Conceptual/EnergyGuide-iOS/FundamentalConcepts.html
INSTANT MOBILE WEB: AN AMP PRIMER
AMP approach: Async JS loading & iFrames
▸ Async JS loading keeps JS off the critical path
▸ Sandbox 3rd party JS in cross-domain iframe (also async)
▸ Block form submission and script execution (eval)
▸ Cannot trigger multiple style re-calcuation
🏖📦<script async src="">
INSTANT MOBILE WEB: AN AMP PRIMER
Recap: Mobile web challenges
📱 Most devices are not powerful
📡 Cellular networks make connections slowly
' JS is usually doing all the heavy lifting
INSTANT MOBILE WEB: AN AMP PRIMER
To AMP or not to AMP
▸ Feel locked into Google ecosystem
▸ Direct traffic vs Google cache

https://www.google.com/amp/s/
amp.theguardian.com/world/2017/oct/05/
nobel-peace-prize-2017-who-are-the-likely-
nominees
▸ Limited analytics data
▸ AMP analytics API supports 

34 analytics platforms!
https://www.ampproject.org/docs/guides/analytics/analytics-vendors
INSTANT MOBILE WEB: AN AMP PRIMER
Live code!
▸ AMP validator plugin
1. Building the AMP boilerplate code
▸ “Hello AMP!”
2. Add embedded media
▸ <amp-youtube>, <amp-image-lightbox>
3. Add user interactivity & remote data:
▸ <amp-sidebar>, <amp-social-share>, 

<amp-list>, <amp-mustache>
http://bit.ly/amp-corgi-repo
LIVE DEMO
<amp-list>
▸ fetches dynamic content from a CORS JSON endpoint

▸ XHR batching: single JSON data request as data source

▸ renders response (data) in a specified template

▸ supports a placeholder and/or fallback

▸ AMP runtime to update height / show overflow element
https://www.ampproject.org/docs/reference/components/amp-list
<amp-mustache>
▸ mustache is a logic-less template syntax

▸ NO if statements, else clauses, for loops etc

▸ Expands {{ }} tags using values provided in a hash or object
https://www.ampproject.org/docs/reference/components/amp-mustache
{
"items": [
{
"title": "AMP By Example",
"url": "https://ampbyexample.com/"
},
{
"title": "AMPproject.org",
"url": "https://www.ampproject.org/"
}
]
}
JSON OBJECT
<template type="amp-mustache">
Hello {{title}}!
</template>
AMP-MUSTACHE TEMPLATE
<div role="list">
<div role="listitem">Hello AMP By Example</div>
<div role="listitem">Hello AMPproject.org</div>
</div>
HTML
INSTANT MOBILE WEB: AN AMP PRIMER
AMP + Progressive Web Apps
https://www.ampproject.org/docs/guides/pwa-amp/amp-to-pwa
INSTANT MOBILE WEB: AN AMP PRIMER
AMP with PWA features
▸ Add a Web App Manifest
for users to install to home
screen
▸ Use Service Worker to
enable offline access
▸ Inject custom JS scripts
that’s not AMP-
compatible
https://www.ampproject.org/docs/guides/pwa-amp/amp-as-pwa#install-a-service-worker-to-enable-offline-access
INSTANT MOBILE WEB: AN AMP PRIMER
AMP as entry point into PWA
<amp-install-serviceworker>
▸ Installs Service Worker from
origin
▸ Let Service Worker intercept
navigation request, and respond
with a PWA
▸ Shell URL rewriting
https://www.ampproject.org/docs/guides/pwa-amp#amp-pages-with-pwa-features
INSTANT MOBILE WEB: AN AMP PRIMER
AMP as data source for PWA
▸ Build AMP pages as modular units 📦
▸ AMP as content source backend
▸ AMP HTML powers both AMP and
PWA experience
https://www.ampproject.org/docs/guides/pwa-amp/amp-in-pwa
INSTANT MOBILE WEB: AN AMP PRIMER
🎉 Thank you! 🎉
Questions? 🤔
Twitter & Github: @lisaychuang
Email: lisa.yc.huang@gmail.com

Más contenido relacionado

La actualidad más candente

AMP - Accelerated Mobile Pages
AMP - Accelerated Mobile PagesAMP - Accelerated Mobile Pages
AMP - Accelerated Mobile PagesIdo Green
 
The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)Christian Heilmann
 
AMPed SEO with Mike Arnesen & SEMpdx
AMPed SEO with Mike Arnesen & SEMpdxAMPed SEO with Mike Arnesen & SEMpdx
AMPed SEO with Mike Arnesen & SEMpdxMike Arnesen
 
2021 Chrome Dev Summit: Web Performance 101
2021 Chrome Dev Summit: Web Performance 1012021 Chrome Dev Summit: Web Performance 101
2021 Chrome Dev Summit: Web Performance 101Tammy Everts
 
AMP Accelerated Mobile Pages - The Next Generation SMX London 2017 Dawn Anderson
AMP Accelerated Mobile Pages - The Next Generation SMX London 2017 Dawn AndersonAMP Accelerated Mobile Pages - The Next Generation SMX London 2017 Dawn Anderson
AMP Accelerated Mobile Pages - The Next Generation SMX London 2017 Dawn AndersonDawn Anderson MSc DigM
 
Amp your site an intro to accelerated mobile pages
Amp your site  an intro to accelerated mobile pagesAmp your site  an intro to accelerated mobile pages
Amp your site an intro to accelerated mobile pagesRobert McFrazier
 
Progressive Web Apps – the return of the web?
Progressive Web Apps – the return of the web?Progressive Web Apps – the return of the web?
Progressive Web Apps – the return of the web?Christian Heilmann
 
Perf ug fastandbeautiful
Perf ug fastandbeautifulPerf ug fastandbeautiful
Perf ug fastandbeautifulDoug Sillars
 
The Soul in The Machine - Developing for Humans
The Soul in The Machine - Developing for HumansThe Soul in The Machine - Developing for Humans
The Soul in The Machine - Developing for HumansChristian Heilmann
 
Meet.js Summit 2019 - PWA in practice
Meet.js Summit 2019 - PWA in practiceMeet.js Summit 2019 - PWA in practice
Meet.js Summit 2019 - PWA in practiceŁukasz Romanowicz
 
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...Katie Sylor-Miller
 
Make JavaScript Faster
Make JavaScript FasterMake JavaScript Faster
Make JavaScript FasterSteve Souders
 
Google AMP (Accelerated Mobile Pages)
Google AMP (Accelerated Mobile Pages)Google AMP (Accelerated Mobile Pages)
Google AMP (Accelerated Mobile Pages)Chitpong Wuttanan
 
Devfest Siberia Fast and Beautiful Images and Video
Devfest Siberia Fast and Beautiful Images and VideoDevfest Siberia Fast and Beautiful Images and Video
Devfest Siberia Fast and Beautiful Images and VideoDoug Sillars
 
Building an Appier Web - May 2016
Building an Appier Web - May 2016Building an Appier Web - May 2016
Building an Appier Web - May 2016Andy Davies
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Christian Heilmann
 
Progressive Web Apps and the Windows Ecosystem [Build 2017]
Progressive Web Apps and the Windows Ecosystem [Build 2017]Progressive Web Apps and the Windows Ecosystem [Build 2017]
Progressive Web Apps and the Windows Ecosystem [Build 2017]Aaron Gustafson
 
AMP Accelerated Mobile Pages - Getting Started & Analytics
AMP Accelerated Mobile Pages - Getting Started & AnalyticsAMP Accelerated Mobile Pages - Getting Started & Analytics
AMP Accelerated Mobile Pages - Getting Started & AnalyticsVincent Koc
 
Performance.now() fast but not furious
Performance.now()   fast but not furiousPerformance.now()   fast but not furious
Performance.now() fast but not furiousAnna Migas
 

La actualidad más candente (20)

AMP - Accelerated Mobile Pages
AMP - Accelerated Mobile PagesAMP - Accelerated Mobile Pages
AMP - Accelerated Mobile Pages
 
The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)
 
AMPed SEO with Mike Arnesen & SEMpdx
AMPed SEO with Mike Arnesen & SEMpdxAMPed SEO with Mike Arnesen & SEMpdx
AMPed SEO with Mike Arnesen & SEMpdx
 
2021 Chrome Dev Summit: Web Performance 101
2021 Chrome Dev Summit: Web Performance 1012021 Chrome Dev Summit: Web Performance 101
2021 Chrome Dev Summit: Web Performance 101
 
AMP Accelerated Mobile Pages - The Next Generation SMX London 2017 Dawn Anderson
AMP Accelerated Mobile Pages - The Next Generation SMX London 2017 Dawn AndersonAMP Accelerated Mobile Pages - The Next Generation SMX London 2017 Dawn Anderson
AMP Accelerated Mobile Pages - The Next Generation SMX London 2017 Dawn Anderson
 
Amp your site an intro to accelerated mobile pages
Amp your site  an intro to accelerated mobile pagesAmp your site  an intro to accelerated mobile pages
Amp your site an intro to accelerated mobile pages
 
Progressive Web Apps – the return of the web?
Progressive Web Apps – the return of the web?Progressive Web Apps – the return of the web?
Progressive Web Apps – the return of the web?
 
Perf ug fastandbeautiful
Perf ug fastandbeautifulPerf ug fastandbeautiful
Perf ug fastandbeautiful
 
The Soul in The Machine - Developing for Humans
The Soul in The Machine - Developing for HumansThe Soul in The Machine - Developing for Humans
The Soul in The Machine - Developing for Humans
 
Meet.js Summit 2019 - PWA in practice
Meet.js Summit 2019 - PWA in practiceMeet.js Summit 2019 - PWA in practice
Meet.js Summit 2019 - PWA in practice
 
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
 
Make JavaScript Faster
Make JavaScript FasterMake JavaScript Faster
Make JavaScript Faster
 
Google AMP (Accelerated Mobile Pages)
Google AMP (Accelerated Mobile Pages)Google AMP (Accelerated Mobile Pages)
Google AMP (Accelerated Mobile Pages)
 
Devfest Siberia Fast and Beautiful Images and Video
Devfest Siberia Fast and Beautiful Images and VideoDevfest Siberia Fast and Beautiful Images and Video
Devfest Siberia Fast and Beautiful Images and Video
 
Building an Appier Web - May 2016
Building an Appier Web - May 2016Building an Appier Web - May 2016
Building an Appier Web - May 2016
 
Cork ux Meetup
Cork ux MeetupCork ux Meetup
Cork ux Meetup
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017
 
Progressive Web Apps and the Windows Ecosystem [Build 2017]
Progressive Web Apps and the Windows Ecosystem [Build 2017]Progressive Web Apps and the Windows Ecosystem [Build 2017]
Progressive Web Apps and the Windows Ecosystem [Build 2017]
 
AMP Accelerated Mobile Pages - Getting Started & Analytics
AMP Accelerated Mobile Pages - Getting Started & AnalyticsAMP Accelerated Mobile Pages - Getting Started & Analytics
AMP Accelerated Mobile Pages - Getting Started & Analytics
 
Performance.now() fast but not furious
Performance.now()   fast but not furiousPerformance.now()   fast but not furious
Performance.now() fast but not furious
 

Similar a Nodevember 2017: AMP Primer

E-commerce Berlin Expo 2018 - From AMP to PWA: A Modern Web User Journey
E-commerce Berlin Expo 2018 - From AMP to PWA: A Modern Web User JourneyE-commerce Berlin Expo 2018 - From AMP to PWA: A Modern Web User Journey
E-commerce Berlin Expo 2018 - From AMP to PWA: A Modern Web User JourneyE-Commerce Berlin EXPO
 
Amp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pagesAmp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pagesRobert McFrazier
 
Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Imran Sayed
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandImran Sayed
 
Performance Optimization for Mobile Web | Fresh Tilled Soil
Performance Optimization for Mobile Web | Fresh Tilled SoilPerformance Optimization for Mobile Web | Fresh Tilled Soil
Performance Optimization for Mobile Web | Fresh Tilled SoilFresh Tilled Soil
 
Developing for Mobile Web
Developing for Mobile WebDeveloping for Mobile Web
Developing for Mobile WebBarbara Bermes
 
SMX@adtech: Mobile Local and Video Search — Cindy Krum
SMX@adtech: Mobile Local and Video Search — Cindy KrumSMX@adtech: Mobile Local and Video Search — Cindy Krum
SMX@adtech: Mobile Local and Video Search — Cindy Krumadtech_fan
 
Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Jon Arne Sæterås
 
Progressive Web Apps - Porque nativo no es significa mejor
Progressive Web Apps - Porque nativo no es significa mejorProgressive Web Apps - Porque nativo no es significa mejor
Progressive Web Apps - Porque nativo no es significa mejorIsrael Blancas
 
Testing installable mobile apps analogues
Testing installable mobile apps analoguesTesting installable mobile apps analogues
Testing installable mobile apps analoguesDiana Pinchuk
 
Taking Web Applications Offline
Taking Web Applications OfflineTaking Web Applications Offline
Taking Web Applications OfflineMatt Casto
 
Building Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalBuilding Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalFour Kitchens
 
ДІАНА ПІНЧУК «Testing installable mobile apps analogues: Android Instant Apps...
ДІАНА ПІНЧУК «Testing installable mobile apps analogues: Android Instant Apps...ДІАНА ПІНЧУК «Testing installable mobile apps analogues: Android Instant Apps...
ДІАНА ПІНЧУК «Testing installable mobile apps analogues: Android Instant Apps...GoQA
 
What's next? J and beyond keynote 2015
What's next? J and beyond keynote 2015What's next? J and beyond keynote 2015
What's next? J and beyond keynote 2015Christian Heilmann
 
Ready to go Mobile? Today's Mobile Landscape: Responsive, Adaptive, Hybrid, a...
Ready to go Mobile? Today's Mobile Landscape: Responsive, Adaptive, Hybrid, a...Ready to go Mobile? Today's Mobile Landscape: Responsive, Adaptive, Hybrid, a...
Ready to go Mobile? Today's Mobile Landscape: Responsive, Adaptive, Hybrid, a...Jeremy Johnson
 
Progressive Web Apps - Goto Chicago 2017
Progressive Web Apps - Goto Chicago 2017Progressive Web Apps - Goto Chicago 2017
Progressive Web Apps - Goto Chicago 2017Christian Heilmann
 
Accelerated Mobile Pages (AMP)
Accelerated Mobile Pages (AMP)Accelerated Mobile Pages (AMP)
Accelerated Mobile Pages (AMP)ijtsrd
 
How to be Successful with Responsive Sites (Koombea & NGINX) - English
How to be Successful with Responsive Sites (Koombea & NGINX) - EnglishHow to be Successful with Responsive Sites (Koombea & NGINX) - English
How to be Successful with Responsive Sites (Koombea & NGINX) - EnglishKoombea
 

Similar a Nodevember 2017: AMP Primer (20)

E-commerce Berlin Expo 2018 - From AMP to PWA: A Modern Web User Journey
E-commerce Berlin Expo 2018 - From AMP to PWA: A Modern Web User JourneyE-commerce Berlin Expo 2018 - From AMP to PWA: A Modern Web User Journey
E-commerce Berlin Expo 2018 - From AMP to PWA: A Modern Web User Journey
 
Amp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pagesAmp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pages
 
Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp Finland
 
Performance Optimization for Mobile Web | Fresh Tilled Soil
Performance Optimization for Mobile Web | Fresh Tilled SoilPerformance Optimization for Mobile Web | Fresh Tilled Soil
Performance Optimization for Mobile Web | Fresh Tilled Soil
 
Faster web pages
Faster web pagesFaster web pages
Faster web pages
 
Developing for Mobile Web
Developing for Mobile WebDeveloping for Mobile Web
Developing for Mobile Web
 
SMX@adtech: Mobile Local and Video Search — Cindy Krum
SMX@adtech: Mobile Local and Video Search — Cindy KrumSMX@adtech: Mobile Local and Video Search — Cindy Krum
SMX@adtech: Mobile Local and Video Search — Cindy Krum
 
Going All-In On AMP
Going All-In On AMPGoing All-In On AMP
Going All-In On AMP
 
Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013
 
Progressive Web Apps - Porque nativo no es significa mejor
Progressive Web Apps - Porque nativo no es significa mejorProgressive Web Apps - Porque nativo no es significa mejor
Progressive Web Apps - Porque nativo no es significa mejor
 
Testing installable mobile apps analogues
Testing installable mobile apps analoguesTesting installable mobile apps analogues
Testing installable mobile apps analogues
 
Taking Web Applications Offline
Taking Web Applications OfflineTaking Web Applications Offline
Taking Web Applications Offline
 
Building Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalBuilding Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with Drupal
 
ДІАНА ПІНЧУК «Testing installable mobile apps analogues: Android Instant Apps...
ДІАНА ПІНЧУК «Testing installable mobile apps analogues: Android Instant Apps...ДІАНА ПІНЧУК «Testing installable mobile apps analogues: Android Instant Apps...
ДІАНА ПІНЧУК «Testing installable mobile apps analogues: Android Instant Apps...
 
What's next? J and beyond keynote 2015
What's next? J and beyond keynote 2015What's next? J and beyond keynote 2015
What's next? J and beyond keynote 2015
 
Ready to go Mobile? Today's Mobile Landscape: Responsive, Adaptive, Hybrid, a...
Ready to go Mobile? Today's Mobile Landscape: Responsive, Adaptive, Hybrid, a...Ready to go Mobile? Today's Mobile Landscape: Responsive, Adaptive, Hybrid, a...
Ready to go Mobile? Today's Mobile Landscape: Responsive, Adaptive, Hybrid, a...
 
Progressive Web Apps - Goto Chicago 2017
Progressive Web Apps - Goto Chicago 2017Progressive Web Apps - Goto Chicago 2017
Progressive Web Apps - Goto Chicago 2017
 
Accelerated Mobile Pages (AMP)
Accelerated Mobile Pages (AMP)Accelerated Mobile Pages (AMP)
Accelerated Mobile Pages (AMP)
 
How to be Successful with Responsive Sites (Koombea & NGINX) - English
How to be Successful with Responsive Sites (Koombea & NGINX) - EnglishHow to be Successful with Responsive Sites (Koombea & NGINX) - English
How to be Successful with Responsive Sites (Koombea & NGINX) - English
 

Último

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Último (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

Nodevember 2017: AMP Primer

  • 1. Instant Mobile Web: An AMP Primer Lisa Huang Nov 2017 Slides: bit.ly/nodevember Twitter/Github: @lisaychuang
  • 2. INSTANT MOBILE WEB: AN AMP PRIMER Hello Nodevember! ▸ Financial analyst > Digital Marketer > Fullstack Engineer ▸ Flatiron School alumnae ▸ Taiwan + Singapore + South Africa + USA ▸ Basic Android phone & buying data by MBs ▸ Discovered AMP project through a SEO course on FrontEndMasters.com
  • 3. INSTANT MOBILE WEB: AN AMP PRIMER Shift Towards Mobile ▸ Oct 2016 - Mobile page views has overtaken Desktop for the first time globally ▸ March 2017 - Android device page views has overtaken Windows ▸ Momentum in this direction is only growing! MOBILE: 48.3% DESKTOP: 46.9% 45.6% 50%50% WINDOWS: 38.8% ANDROID: 39.2% 40.3% 50% 37.8% http://gs.statcounter.com/os-market-share/desktop-mobile/worldwide/#monthly-201606-201711 http://gs.statcounter.com/platform-market-share/desktop-mobile-tablet/worldwide/#monthly-201606-201711
  • 4. INSTANT MOBILE WEB: AN AMP PRIMER Performance === 💰💸 ➡ wpostats.com ⬅ ▸ Google: +800ms page load time = -$1M daily revenue loss ▸ Financial Times: +3000ms load time = 7.2% drop in user engagement ▸ Walmart: -1000ms load time = +2% increase in conversion ▸ AliExpress: -36% load time = +10.5% increase in orders
  • 5. INSTANT MOBILE WEB: AN AMP PRIMER ▸ AMP is an open source framework to build really fast mobile pages ▸ Create instantly loading mobile pages ▸ 4 Billion+ pages, 25million+ domains, 100+ languages ▸ May 2017: Google mobile search AMP Top Stories Carousel global rollout https://www.ampproject.org/ https://techcrunch.com/2016/02/24/google-now-highlights-amp-pages-in-its-mobile-search-results/
  • 6. INSTANT MOBILE WEB: AN AMP PRIMER Content Platforms that enable AMP https://www.ampproject.org/support/faqs/supported-platforms ▸ Facebook ▸ Twitter ▸ WordPress ▸ Google ▸ Medium ▸ Pinterest ▸ LinkedIn ▸ Reddit ▸ Nuzzel ▸ Hatena ▸ Squarespace ▸ Ghost ▸ Drupal ▸ Fastcommerce ▸ Canvas https://www.ampproject.org/latest/blog/amp-two-years-of-user-first-webpages/
  • 7. INSTANT MOBILE WEB: AN AMP PRIMER Content Platforms AMP Works On https://www.ampproject.org/support/faqs/supported-platforms ▸ Facebook ▸ Twitter ▸ WordPress ▸ Google ▸ Medium ▸ Pinterest ▸ LinkedIn ▸ Reddit ▸ Nuzzel ▸ Hatena ▸ Squarespace ▸ Ghost ▸ Drupal ▸ Fastcommerce ▸ Canvas https://www.ampproject.org/latest/blog/amp-two-years-of-user-first-webpages/
  • 8. INSTANT MOBILE WEB: AN AMP PRIMER Content Platforms AMP Works On https://www.ampproject.org/support/faqs/supported-platforms ▸ Facebook ▸ Twitter ▸ WordPress ▸ Google ▸ Medium ▸ Pinterest ▸ LinkedIn ▸ Reddit ▸ Nuzzel ▸ Hatena ▸ Squarespace ▸ Ghost ▸ Drupal ▸ Fastcommerce ▸ Canvas https://www.ampproject.org/latest/blog/amp-two-years-of-user-first-webpages/
  • 9. INSTANT MOBILE WEB: AN AMP PRIMER Who is publishing with AMP Today? https://www.ampproject.org/latest/blog/amp-two-years-of-user-first-webpages/
  • 10. INSTANT MOBILE WEB: AN AMP PRIMER Google I/O May 2017 announcements ▸ Before: focused on static content ▸ Now: interactive content, moving towards an interactive framework ▸ Future: ecommerce, highly interactive experiences ▸ AMP to PWA! https://www.ampproject.org/docs/guides/pwa-amp
  • 11. INSTANT MOBILE WEB: AN AMP PRIMER Mobile Web Challenges 📱 Most devices are not powerful 📡 Cellular networks make connections slowly ' JS is usually doing all the heavy lifting
  • 12. INSTANT MOBILE WEB: AN AMP PRIMER 📱 Challenge #1: Most devices are not powerful
  • 13. INSTANT MOBILE WEB: AN AMP PRIMER ▸ Complex CSS animations ▸ Video viewing ▸ Data download & processing ▸ Background Processes (Web Worker) ▸ Push notifications ▸ GPS ▸ Sensors: accelerometer, gyroscope, magnetometer requests https://developer.apple.com/library/content/documentation/Perf 🐢 Underpowered Devices - What’s slow?
  • 14. INSTANT MOBILE WEB: AN AMP PRIMER Case Study: CSS Animations ▸ Animate the ball by iteratively setting the left position ▸ Triggers re-layout calculations, “janky” animation ▸ This experience is never desirable!
  • 15. INSTANT MOBILE WEB: AN AMP PRIMER Case Study: CSS Animations ▸ Animate the ball using transform: translateX() ▸ GPU optimized and does not trigger a re-layout ▸ Only re-composition is required
  • 16. INSTANT MOBILE WEB: AN AMP PRIMER Underpowered Devices - AMP approach: Subset CSS ▸ Only subset of CSS allowed ▸ Max. 50KB total CSS ▸ Animation: only GPU-accelerated properties allowed ▸ Use transform and opacity changes https://developers.google.com/web/fundamentals/performance/rendering/stick-to-compositor-only-properties-and-manage-layer-count ➡ https://csstriggers.com/ ⬅
  • 17. INSTANT MOBILE WEB: AN AMP PRIMER Underpowered Devices: AMP custom components ▸ Pre-calculate initial viewport layout with <amp-img> ▸ specified fixed height & width ▸ includes placeholder, and a fallback https://www.ampproject.org/docs/
  • 18. INSTANT MOBILE WEB: AN AMP PRIMER 📡 Challenge #2: Cellular networks make connections slowly ▸ Slow to initiate network connection ▸ Mobile network requests are extra expensive, and involve extra latency ▸ 2G: 300 - 1000ms, 3G: 100 - 300ms extra, 4G: 10 - 100ms extra https://developers.google.com/speed/docs/insights/mobile
  • 19. INSTANT MOBILE WEB: AN AMP PRIMER Cellular: What’s slow? 📱 🖥 50% of pages involve > 76 requests
  • 20. Tested From: Dulles, VA, “Good 2G speed” Chrome - Emulated Motorola G (Gen 4)📱 webpagetest.org Case Study: Adobe Typekit Blog
  • 21. INSTANT MOBILE WEB: AN AMP PRIMER AMP approach: Inlined CSS ▸ Inlined CSS stylesheet! ▸ When HTML lands —> Mobile page is ready for basic use! https://medium.com/@cramforce/why-amp-html-does-not-take-full-advantage-of-the-preload-scanner-7e7f788aa94e HTML CSS JSSingle Page App 🌟 HTML CSS JS AMP Html 🌟 <style amp-custom="">##...#</style>
  • 22. INSTANT MOBILE WEB: AN AMP PRIMER AMP approach: Prioritize resource loading ▸ Control network requests to prioritize resources effectively ▸ Prefetches and lazy-loads resources: ▸ Resources are prefetched as early as possible (⬇ the fold), but... ▸ lazy-loaded as late as possible (CPU is only used when resources are actually shown to users) https://medium.com/@cramforce/why-amp-html-does-not-take-full-advantage-of-the-preload-scanner-7e7f788aa94e
  • 23. INSTANT MOBILE WEB: AN AMP PRIMER AMP approach: AMP Cache ▸ AMP pages will be cached when they’re discovered (or updates are found)
 ▸ This saves the overhead of DNS resolution & SSL handshake https://developers.google.com/amp/cache/overview https://blog.cloudflare.com/accelerated-mobile/
  • 24. INSTANT MOBILE WEB: AN AMP PRIMER ' Challenge #3: JS doing all the heavy lifting
  • 25. INSTANT MOBILE WEB: AN AMP PRIMER Heavy JS: What’s slow? ▸ Synchronous JS pauses HTML parsing, it resumes once download completes ▸ Parsing the downloaded JS takes time (related to code size & other factors) ▸ ⚠ Server-side rendering aims to help, but is incredibly complex to get right https://developer.apple.com/library/content/documentation/Performance/Conceptual/EnergyGuide-iOS/FundamentalConcepts.html
  • 26. INSTANT MOBILE WEB: AN AMP PRIMER AMP approach: Async JS loading & iFrames ▸ Async JS loading keeps JS off the critical path ▸ Sandbox 3rd party JS in cross-domain iframe (also async) ▸ Block form submission and script execution (eval) ▸ Cannot trigger multiple style re-calcuation 🏖📦<script async src="">
  • 27. INSTANT MOBILE WEB: AN AMP PRIMER Recap: Mobile web challenges 📱 Most devices are not powerful 📡 Cellular networks make connections slowly ' JS is usually doing all the heavy lifting
  • 28. INSTANT MOBILE WEB: AN AMP PRIMER To AMP or not to AMP ▸ Feel locked into Google ecosystem ▸ Direct traffic vs Google cache
 https://www.google.com/amp/s/ amp.theguardian.com/world/2017/oct/05/ nobel-peace-prize-2017-who-are-the-likely- nominees ▸ Limited analytics data ▸ AMP analytics API supports 
 34 analytics platforms! https://www.ampproject.org/docs/guides/analytics/analytics-vendors
  • 29. INSTANT MOBILE WEB: AN AMP PRIMER Live code! ▸ AMP validator plugin 1. Building the AMP boilerplate code ▸ “Hello AMP!” 2. Add embedded media ▸ <amp-youtube>, <amp-image-lightbox> 3. Add user interactivity & remote data: ▸ <amp-sidebar>, <amp-social-share>, 
 <amp-list>, <amp-mustache> http://bit.ly/amp-corgi-repo
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41. LIVE DEMO <amp-list> ▸ fetches dynamic content from a CORS JSON endpoint ▸ XHR batching: single JSON data request as data source ▸ renders response (data) in a specified template ▸ supports a placeholder and/or fallback ▸ AMP runtime to update height / show overflow element https://www.ampproject.org/docs/reference/components/amp-list
  • 42. <amp-mustache> ▸ mustache is a logic-less template syntax ▸ NO if statements, else clauses, for loops etc ▸ Expands {{ }} tags using values provided in a hash or object https://www.ampproject.org/docs/reference/components/amp-mustache { "items": [ { "title": "AMP By Example", "url": "https://ampbyexample.com/" }, { "title": "AMPproject.org", "url": "https://www.ampproject.org/" } ] } JSON OBJECT <template type="amp-mustache"> Hello {{title}}! </template> AMP-MUSTACHE TEMPLATE <div role="list"> <div role="listitem">Hello AMP By Example</div> <div role="listitem">Hello AMPproject.org</div> </div> HTML
  • 43. INSTANT MOBILE WEB: AN AMP PRIMER AMP + Progressive Web Apps https://www.ampproject.org/docs/guides/pwa-amp/amp-to-pwa
  • 44. INSTANT MOBILE WEB: AN AMP PRIMER AMP with PWA features ▸ Add a Web App Manifest for users to install to home screen ▸ Use Service Worker to enable offline access ▸ Inject custom JS scripts that’s not AMP- compatible https://www.ampproject.org/docs/guides/pwa-amp/amp-as-pwa#install-a-service-worker-to-enable-offline-access
  • 45. INSTANT MOBILE WEB: AN AMP PRIMER AMP as entry point into PWA <amp-install-serviceworker> ▸ Installs Service Worker from origin ▸ Let Service Worker intercept navigation request, and respond with a PWA ▸ Shell URL rewriting https://www.ampproject.org/docs/guides/pwa-amp#amp-pages-with-pwa-features
  • 46. INSTANT MOBILE WEB: AN AMP PRIMER AMP as data source for PWA ▸ Build AMP pages as modular units 📦 ▸ AMP as content source backend ▸ AMP HTML powers both AMP and PWA experience https://www.ampproject.org/docs/guides/pwa-amp/amp-in-pwa
  • 47. INSTANT MOBILE WEB: AN AMP PRIMER 🎉 Thank you! 🎉 Questions? 🤔 Twitter & Github: @lisaychuang Email: lisa.yc.huang@gmail.com