Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[Andrey Lipattsev] AMP in 2018. Still fast, still furious

[Andrey Lipattsev] AMP in 2018. Still fast, still furious

Presentation from GDG DevFest Ukraine 2017 - the biggest community-driven Google tech conference in the CEE.

Learn more at: https://devfest.gdg.org.ua

Google Developers Group Lviv

October 14, 2017
Tweet

More Decks by Google Developers Group Lviv

Other Decks in Technology

Transcript

  1. AMP 2018. Still fast! Still furious! New features and examples

    Andrey Lipattsev Strategic Partner Development Manager @ Google
  2. #dfua <html ⚡> <amp-what>“What is AMP?”</amp-what> <amp-why>“Why is AMP fast?”</amp-why>

    <amp-where>“Where is AMP used?”</amp-where> <amp-build>“What can I build?”</amp-build>
  3. #dfua AMP documents are only valid if they do not

    contain things that might be slow
  4. <!doctype html> <html ⚡> <head> <meta charset="utf-8"> <link rel="canonical" href="hello-world.html">

    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> <style amp-boilerplate>(✄ snip!)</style><noscript><style amp-boilerplate>(✄ snip!)</style></noscript> <script async src="https://cdn.ampproject.org/v0.js"></script> </head> <body>Hello World!</body> </html>
  5. <!doctype html> <html ⚡> | <html amp> <head> <meta charset="utf-8">

    <link rel="canonical" href="hello-world.html"> <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> <style amp-boilerplate>(✄ snip!)</style><noscript><style amp-boilerplate>(✄ snip!)</style></noscript> <script async src="https://cdn.ampproject.org/v0.js"></script> </head> <body>Hello World!</body> </html>
  6. <!doctype html> <html ⚡> <head> <meta charset="utf-8"> <link rel="canonical" href="hello-world.html">

    <link rel="amphtml" href="hello-world.amp.html"> <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> <style amp-boilerplate>(✄ snip!)</style><noscript><style amp-boilerplate>(✄ snip!)</style></noscript> <script async src="https://cdn.ampproject.org/v0.js"></script> </head> <body>Hello World!</body> </html>
  7. <!doctype html> <html ⚡> <head> <meta charset="utf-8"> <link rel="canonical" href="hello-world.html">

    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> <script async src="https://cdn.ampproject.org/v0.js"></script> </head> <body>Hello World!</body> </html>
  8. <!doctype html> <html ⚡> <head> <meta charset="utf-8"> <link rel="canonical" href="hello-world.html">

    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> <style amp-boilerplate>(✄ snip!)</style><noscript><style amp-boilerplate>(✄ snip!)</style></noscript> <script async src="https://cdn.ampproject.org/v0.js"></script> </head> <body>Hello World!</body> </html>
  9. <!doctype html> <html ⚡> <head> <meta charset="utf-8"> <link rel="canonical" href="hello-world.html">

    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> <style amp-boilerplate>(✄ snip!)</style><noscript><style amp-boilerplate>(✄ snip!)</style></noscript> <script async src="https://cdn.ampproject.org/v0.js"></script> </head> <body>Hello World!</body> </html>
  10. #dfua The library managing: • Resource loading • Core web

    components • Performance optimizations https://github.com/ampproject/amphtml
  11. #dfua • Cache of valid AMP documents available for anyone

    • HTTP/2 with same origin for all resources • Google products all serve via the AMP cache • API available to query AMP documents
  12. #dfua All scripts are async Static resource sizing Extended components

    do not block page layout 3rd party JS only in sandboxed iframes CSS limit ... Why is AMP fast
  13. #dfua ... Zero HTTP requests until fonts start downloading Minimal

    style recalculations GPU optimizable animations only Resource prioritization Prerendering Why is AMP fast
  14. #dfua Header Logo Responsive hero image Headline Article text Image

    in article Some more text Ad 1st viewport Resource prioritization
  15. #dfua Header Logo Responsive hero image Headline Article text Image

    in article Some more text Ad 1st viewport Prerendering
  16. #dfua -- What can I build with AMP --- Ok,

    ok, ok, fine so… What can - can’t --
  17. #dfua AliExpress 10.5% Reducing load time by 36% lead to

    increase in orders 27% increase in conversion rates
  18. #dfua 1. Store product data in <amp-state> 2. Add [text]

    binding to price label 3. Change the selectedColor variable with AMP.setState amp-bind