Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
AMP 完全に理解した
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
bakunyo
September 22, 2018
Technology
420
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AMP 完全に理解した
bakunyo
September 22, 2018
More Decks by bakunyo
See All by bakunyo
合宿成果@日本色
bakunyo
0
140
GitHub Actions CI/CD Update
bakunyo
0
290
NNにふれてみて
bakunyo
0
1.1k
RoRoRoRoR
bakunyo
0
970
Other Decks in Technology
See All in Technology
Microsoft 365 Copilot chat -tekoälypalvelun tietosuojaongelmat
hponka
0
560
Tab5をRubyで動くパソコンにする
kishima
2
280
Bet AI Day 2026丨AIを「使う」から、AIが「働く」へ ― LayerXが進める「組織AI」の社会実装
layerx
PRO
3
2.8k
深夜のクラウド懺悔室 1:29:300 or 1:0:0
kazzpapa3
0
210
AI 駆動 Terraform 開発/SRE_BizReach_MIXI_2
visional_engineering_and_design
3
2k
V8コントリビュート超入門
riyaamemiya
0
160
振り返りこそエンジニアの本領
negima
0
350
Driving AI Adoption Using In-House GPUs to Serve Qwen
po3rin
2
470
Bet AI Day 2026丨バクラク Autopilot、業務システムの再設計
layerx
PRO
2
1.7k
2026-09-10 【Snowflake World Tour Tokyo 2026】dbt Core と Snowflake で実現する多層的なデータガバナンス / Multi-Layered Data Governance Powered by dbt Core and Snowflake
civitaspo
0
260
Redmine 7.0で私が開発した新機能の狙いと背景
vividtone
1
130
現場に行くだけでは足りない——プロダクトエンジニアが業務の流れを捉える観点と、その鍛え方
takumiengineering
0
350
Featured
See All Featured
The Mindset for Success: Future Career Progression
greggifford
PRO
0
490
Everyday Curiosity
cassininazir
0
310
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
680
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
370
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
Amusing Abliteration
ianozsvald
1
290
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Code Review Best Practice
trishagee
74
20k
Transcript
AMP 完全に理解した 2018/09/22 【第4回】JSフレームワーク(またはライブラリ)× ビアバッシュ 初⼼者勉強会 Izuta Hiroyuki
⾃⼰紹介 • ⽒名: いずた ひろゆき • Twitter・GitHub: @bakunyo • フリーランスエンジニア
https://twitter.com/ito_yusaku/status/1042604780718157824 ちょい前にバズってたやつ
࣍ • AMP 概要 • 事例紹介 • AMP の今後
AMP 概要
AMP って何 • Accelerated Mobile Pages の略 • Google が中⼼となって進めているオープンソースプロジェクト
• モバイル環境でも快適・⾼速にウェブサイトを閲覧できるよう にするための仕組み ←モバイルのGoogle検索結果 でこのマークがついてるページは AMP対応済
AMP の構成要素 • AMP HTML • AMP JS • AMP
Cache
AMP HTML • パフォーマンスを維持するために制限が課せられたHTML • ⼀部は AMP 固有タグに置き換えられる(amp-xxx) • 制限の例
• CSS は head 内にインライン記述 • JS は基本的に使⽤できない(AMP JSを除く)
AMP JS • AMP HTML で利⽤が許された JS の外部リソース • async
で読み込むため、レンダリングブロックしない • 後ほどいくつか紹介
AMP Cache • AMP が有効なページをキャッシュして返すコンテンツ配 信ネットワーク • = Google AMP
Cache • 後ほどもう少し詳しく
AMP 概要 おさらい • AMP HTML • パフォーマンスのために制限が課せられたHTML • AMP
JS • AMP HTML で使える JS 外部リソース • AMP Cache • AMP ⽤コンテンツ配信ネットワーク
事例紹介
事例紹介 • 最新巻.jp • “巻” なので注意 • マンガの最新巻情報をお知らせ • 全ページAMP対応
• レスポンシブ
AMP JS コンポーネント紹介
amp-image-lightbox 画像タップでフルスクリーン表⽰ ※あの丸⼭ゴンザレスさん著作の グルメ漫画(9/21発売)
amp-lightbox-gallery 複数の画像をまとめられる フォトギャラリー 横スライドで次の画像へ
amp-iframe AMP で iframe が使えるようになるタグ 漫画のコマが著作権的に安⼼して使える マンガルーさん( https://mangaloo.jp/ )の
埋め込みフレームに利⽤ iframe の中では実は JS が使える
AMP JS を使った実装( amp-img の例) 1. タグ毎に必要な JS ライブラリを head
で async 読み込み <script async src="https://cdn.ampproject.org/v0.js"></script> 2. AMP 固有タグを使う <amp-img {src, alt, layout などのタグ毎に必要な属性}></amp-img> 3. 基本的にこれだけ ゆとりに優しい仕様
AMP Cache をもう少し詳しく
スマホで「最新巻jp」の検索結果 Google 検索結果 Yahoo! JAPAN 検索結果
Google 検索結果 → AMP ⽤ページ www.google.jp/amp/s/{ドメイン} にて配信される (⽶ Google では
.com) CDNから配信されていることを⽰すヘッダー をクリックするとキャッシュ元ページへ 遷移する 【メタタグ関連】 ・robots = noindex ・canonical はキャッシュ元ページ
search.yahoo.co.jp/amp/s/{ドメイン}/… にて配信される ヘッダーの挙動、メタタグともに Googleとほぼ同じ Yahoo! JAPAN 検索結果 → AMP⽤ページ
中⾝は iframe Google も Yahoo も、同じURLを 参照 最新巻-jp.cdn.ampproject.org
というサブドメインが切られている Google AMP Cache ドキュメント https://developers.google.com/amp/cache/ にサブドメインのルールについて記載がある
なので URL開けば普通に⾒れる ←ヘッダー表⽰⽤スペースもあり AMP Cache コンテンツ配信プラット フォームは、ヘッダー部分を独⾃実装 して
iframe で中⾝を指定してやれば いけそう
流れ再確認 (PPHMF".1$BDIF \υϝΠϯ^DEOBNQQSPKFDUPSH (PPHMFݕࡧ".1༻ϖʔδ XXXHPPHMFKQBNQT\υϝΠϯ^ :BIPPݕࡧ".1༻ϖʔδ TFBSDIZBIPPDPKQBNQT\υϝΠϯ^ ①検索結果がAMP Cache済 ならAMP⽤ページを表⽰
②iframeから参照
AMP の今後
イベント • AMP Contributor Summit • https://events.withgoogle.com/amp-contributor-summit/ • 2018/09/25-26 @Google
in Mountain View, California • AMP Roadshow • https://www.ampproject.org/amp-roadshow/ • 来⽉、インドの3都市にて開催
Bing 9⽉19⽇にアナウンス Introducing Bing AMP viewer and Bing AMP cache
https://blogs.bing.com/Webmaster-Blog/September-2018/Introducing- Bing-AMP-viewer-and-Bing-AMP-cache ※⼿元では確認できず
使ってみての感想 • AMP の制限を守ろうとすると、⾃然とパフォーマンスが よくなる • AMP JS でできることがどんどん増えているため、サイト をつくるうえで困ることがそんなに無くなってくる
• もう少し⾒守ります
APPENDIX • 公式サイト • https://www.ampproject.org/ • AMP by Example •
https://ampbyexample.com • GitHub • https://github.com/ampproject • Google AMP Cache ドキュメント • https://developers.google.com/amp/cache/ • Yahoo!検索ヘルプ AMP対応ページ表⽰について • https://www.yahoo-help.jp/app/answers/detail/p/595/a_id/138177/~/ amp%E5%AF%BE%E5%BF%9C%E3%83%9A%E3%83%BC%E3%82%B8%E8%A1%A8%E7%A4%BA%E3 %81%AB%E3%81%A4%E3%81%84%E3%81%A6