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
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
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
フロントエンドエンジニアのためのServer Push入門 / Server Push for...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Masashi Hirano
June 07, 2018
Programming
410
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
フロントエンドエンジニアのためのServer Push入門 / Server Push for Frontend Engineer
JAM plus #1 でNetlifyでHTTP/2サーバプッシュするLTしました
https://kfug.connpass.com/event/87799/
Masashi Hirano
June 07, 2018
More Decks by Masashi Hirano
See All by Masashi Hirano
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
7
5.1k
Protocol Buffers and Connect for Frontend Development
masashi
0
180
You may not need XXX in Node.js
masashi
5
2.1k
OSSとコミュニティを支える
masashi
1
2.3k
英語ができなかった自分達が、グローバルチーム立ち上げに挑戦!?
masashi
1
3.9k
フロントエンド開発のためのセキュリティ入門について
masashi
1
610
フロントエンド開発のためのセキュリティ入門
masashi
50
19k
Node.jsの2022年と未来 / Node.js in 2022 and Future
masashi
1
1.2k
Corepack ~Node.jsに追加されたパッケージマネージャーマネージャー~ / #tng37
masashi
3
13k
Other Decks in Programming
See All in Programming
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
150
Security issues being discussed on Web Platforms
petamoriken
0
1.4k
Workers Cache を知る
syumai
0
310
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
130
アクセシビリティから考える情報設計
high_g_engineer
0
430
カツオ、ご期待ください
suneo3476
0
120
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
180
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
180
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
280
JRuby: Past, Present, and Future
headius
0
210
一人だけ、Kiroが静止する日
hideg
0
140
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2k
Featured
See All Featured
It's Worth the Effort
3n
188
29k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
530
Balancing Empowerment & Direction
lara
6
1.3k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
From π to Pie charts
rasagy
1
380
Bash Introduction
62gerente
615
220k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
400
Transcript
ϑϩϯτΤϯυ ΤϯδχΞͷͨΊͷ Server Pushೖ JAM plus #1 Masashi Hirano
(@shisama)
{ "about": { "name": "Masashi Hirano", "works": "Weblio, Inc.", "twitter":
"@shisama_", "github": "shisama" } }
λʔήοτ • ૣ͍WebΛఏڙ͍ͨ͠ਓ • αʔόઃఆͨ͘͠ͳ͍ ָ͍ͨ͠ϑϩϯτΤϯ υΤϯδχΞͷօ༷
ࠓ͞ͳ͍͜ͱ • HTTP/1.1HTTP/2ͷৄࡉ • αʔόͷ
HTTP/1.1ͷ • 1ͭͷϦΫΤετ͕ྃ͢Δ·Ͱ࣍ͷϦΫΤετߦ͑ͳ͍ • ଟॏԽ͢Δ͜ͱͰ1υϝΠϯͷෳଓՄೳ • ಉ࣌ଓݶΒΕ͍ͯΔ • Chromeͷ߹6ͭ·Ͱ͔͠ಉ࣌ଓͰ͖ͳ͍ https://codezine.jp/article/detail/8663
HTTP/1.1ͷ • HTTPύΠϓϥΠϯ • લճͷϦΫΤετΛͨͣʹ࣍ͷϦΫΤετΛૹ৴Մೳ • αʔόʔϦΫΤετͷॱ൪௨ΓʹϨεϙϯεΛฦ͞ͳ͚ΕͳΒͳ͍ • ઌ಄ͷϦΫΤετʹ͕͔͔࣌ؒͬͨ߹ɺޙଓͷϨεϙϯεϒϩοΫ ͞ΕΔ
https://codezine.jp/article/detail/8663
HTTP/1.1ͷ • ߴͳWeb͕ٻΊΒΕΔݱ • ϦΫΤετΛݮΒ͍ͨ͠ • CSSεϓϥΠτɺJSϑΝΠϧͷόϯυϧͳͲͰ ରԠ͍ͯ͠Δ͕ਏ͍ • όϯυϧͨ͠ϑΝΠϧͷେ͖͕͞ʹͳΔ͜
ͱ
HTTP/2
HTTP/2ͱ • HTTP/1.1ͷϨΠςϯγΛղܾ͢ΔͨΊͷ৽͠ ͍ϓϩτίϧ • HTTP/1.1͔Β16ͿΓͷΞοϓσʔτ • 2015ʹRFCԽࡁΈ(RFC7540) • ΄΅ͯ͢ͷϒϥβ͕ରԠ(IE11!)
HTTP/2ͷओͳػೳ • ετϦʔϜͷଟॏԽ • ετϦʔϜͷ༏ઌ • ϑϩʔ੍ޚ • ϔομѹॖ(HPACK) •
αʔόϓογϡ
HTTP/2ͷओͳػೳ • ετϦʔϜͷଟॏԽ • ετϦʔϜͷ༏ઌ • ϑϩʔ੍ޚ • ϔομѹॖ(HPACK) •
αʔόϓογϡ
αʔόϓογϡͱ • Ϧιʔεऔಘʹ1RTT(ϦΫΤετ+Ϩεϙϯε)Λඞཁͱ͠ͳ͍ • ࠷ॳͷϦΫΤετΛड͚औͬͨαʔό͕࣍ͷϦΫΤετΛ༧ ଌͯ͠ΫϥΠΞϯτʹpush͢Δ )5.-ͷϦΫΤετʹର ͯ͠$44ͱը૾Λಉ࣌ʹ ৴͍ͯ͠Δ https://giuseppeciotta.net/getting-to-know-http20-with-the-mosaic-demo.html
αʔόΛ৮Βͳ͚Ε͍͚ͳ͍ͷͰ͠ΐɾɾɾ
ϑϩϯτΤϯυ ΤϯδχΞͷͨΊͷ Server Pushೖ Masashi Hirano (@shisama)
ϑϩϯτΤϯυ ΤϯδχΞͷͨΊͷ Server Pushೖ Masashi Hirano (@shisama) αʔόͷ͠·ͤΜʂʂ
Netlify
Netlifyͱ • ߴػೳϗεςΟϯάαʔϏε • ϏϧυɾσϓϩΠɾϗεςΟϯάΛͯ͢ߦ͑Δ • GitHubʹ͋ΔϦϙδτϦΛͦͷ··ϗεςΟϯ άͰ͖Δɻpush͢ΔͨͼʹࣗಈσϓϩΠ • HTTPSɺHTTP/2͕ແྉͰ؆୯ʹ͑Δ
https://www.netlify.com/blog/2017/07/18/http/2-server-push-on-netlify/
NetlifyͰαʔόϓογϡ • σϓϩΠ͢ΔσΟϨΫτϦʹ_headersͱ͍͏ ϑΝΠϧΛஔ͚ͩ͘ • _headersʹͲͷϦιʔεΛpush͢Δͷ͔ॻ͘
NetlifyͰαʔόϓογϡ . !"" public # !"" _headers # !"" my-app.js
# !"" index.html # %"" style.css %"" src !"" my-app.js !"" index.html %"" style.css QVCMJDΛσϓϩΠ͢Δ߹ɺ QVCMJDԼʹ@IFBEFSTΛஔ͘
_headersϑΝΠϧ /server-push-path Link: </my-app.js>; rel=preload; as=script Link: </style.css>; rel=preload; as=style
ϦΫΤετͷύε -JOLQVTI͍ͨ͠ϦιʔεͷύεSFMQSFMPBEBTϦιʔεͷछྨ
Ϩεϙϯεϔομʔ ϦΫΤετͨ͠IUNMͷϨεϙϯεϔομʔ ʹMJOL͕Ճ͞ΕΔ
HTTP1.1ͱHTTP/2 ൺֱ $ISPNFͷ߹ɺ)551ͩͱ 1SPUPDPM͕IʹͳΔ
HTTP1.1ͱHTTP/2 ൺֱ *OJUJBUPS͕1VTI0UIFSʹͳ͍ͬͯͯαʔ όϓογϡ͞Ε͍ͯΔ͜ͱ͕Θ͔Δ
αʔόϓογϡ͕ෆཁʹͳͬͨΒ /server-push-path Link: </my-app.js>; rel=preload; as=script nopush Link: </style.css>; rel=preload;
as=style OPQVTIΛ͚Δ
None
firebaseͱ • GoogleͷϞόΠϧϓϥοτϑΥʔϜ • Realtime DatabaseɺCloud Functionɺ Crashlytics etc •
ϗεςΟϯάαʔϏε͋Δ • ແྉͰHTTPSHTTP/2͕͑Δ
firebaseͰαʔόϓογϡ . !"" firebase.json !"" public # !"" img1.png #
!"" index.html # %"" style.css %"" src !"" img1.png !"" index.html %"" style.css pSFCBTFKTPOΛஔ͘
firebase.json { "hosting": { "public": "public", "headers": [ { "source":
"/", "headers": [{ "key": "Link", "value": "</elements/my-app.js>;rel=preload;as=script,</ style.css>;rel=preload;as=style" }] } ] } }
·ͱΊ • HTTP/2αʔόϓογϡͰϦΫΤετΛݮΒ ͠ϖʔδϩʔυΛߴԽ • ߴػೳϗεςΟϯάαʔϏεΛ͏͜ͱͰ HTTP/2αʔόϓογϡ؆୯ʹ͑Δ
એ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠