Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Optimizing Contents Delivery
Search
Gen
March 24, 2017
Programming
0
28
Optimizing Contents Delivery
Gen
March 24, 2017
Tweet
Share
More Decks by Gen
See All by Gen
VRT
gen
0
9
Introduction to WebRTC
gen
0
230
Introduction to ECS
gen
0
38
Introduction to multiplayer netcode
gen
0
74
Introduction to WebGL
gen
0
50
部屋のワイシャツとカメラと私
gen
0
410
Interaction designer のお仕事
gen
0
81
Other Decks in Programming
See All in Programming
Navigating Dependency Injection with Metro
zacsweers
3
1k
AI時代のUIはどこへ行く?
yusukebe
18
9k
Rancher と Terraform
fufuhu
2
550
Performance for Conversion! 分散トレーシングでボトルネックを 特定せよ
inetand
0
930
そのAPI、誰のため? Androidライブラリ設計における利用者目線の実践テクニック
mkeeda
2
360
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
310
アセットのコンパイルについて
ojun9
0
130
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
870
AIでLINEスタンプを作ってみた
eycjur
1
230
複雑なフォームに立ち向かう Next.js の技術選定
macchiitaka
2
170
複雑なドメインに挑む.pdf
yukisakai1225
5
1.2k
ファインディ株式会社におけるMCP活用とサービス開発
starfish719
0
1.8k
Featured
See All Featured
BBQ
matthewcrist
89
9.8k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Optimizing for Happiness
mojombo
379
70k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
The Cult of Friendly URLs
andyhume
79
6.6k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.8k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.7k
Typedesign – Prime Four
hannesfritz
42
2.8k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Scaling GitHub
holman
463
140k
Transcript
Optimizing Contents Delivery Gen Ichino<@zenoplex>
໔ࣄ߲ (͍͍Θ͚λΠϜ) • FP, FRP ͷ͠·ͤΜ • Rx ͷ͠·ͤΜ •
τʔΫεΫϦϓτ࿅श͍ͯ͠ͳ͍Ͱ͢ • 2018 ʹ͋ͨΓલʹͳΔ͔͠Εͳ͍
“Mobile First” FTW http://gs.statcounter.com/press/mobile-and-tablet-internet-usage-exceeds- desktop-for- fi rst-time-worldwide
Code splitting
Why?
bundle.js
bundle.js vendor.js
Long-term caching • มߋ͕΄ͱΜͲೖΒͳ͍Ϟδϡʔϧ܈ • bundle໊ʹhashΛ͏ • max-age: 31536000 (RFC
2616) • CDN
vendor.js Home Settings User menu button Login
How?
es6 Dynamic Import // sync import React from 'react'; //
sync import { Component } from 'react'; // async const AsyncModulePromise = import('../some_modules');
import() • babel-plugin: syntax-dynamic-import • Stage 3 • Webpack 2
• (path: string) => Promise<*> • Support dynamic module name
DEMO https://syntax-dynamic-import-sample.herokuapp.com/
Webpack
React
React Components • Functions • Classes • Promises
DEMO https://syntax-dynamic-import-react-sa.herokuapp.com/
Where?
Where to code split • Route level • High Order
Components
DEMO https://syntax-dynamic-import-react-sa.herokuapp.com/about
Overhead • Heroku still only supports HTTP/1.1 • Overuse can
lead to less user experience
Is JavaScript mobile friendly?
Responsive Component • Mobile First JavaScript • Always render Mobile
Components • Lazy load Desktop Components when and only if necessary
Thx