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
iOS 17で追加されたSubscriptionStoreView を利用して5分でサブスク実装チャレンジ
natmark
0
660
Model Pollution
hschwentner
1
190
CSC305 Lecture 05
javiergs
PRO
0
210
Six and a half ridiculous things to do with Quarkus
hollycummins
0
140
Flutterで分数(Fraction)を表示する方法
koukimiura
0
120
CSC509 Lecture 03
javiergs
PRO
0
330
GitHub Actions × AWS OIDC連携の仕組みと経緯を理解する
ota1022
0
250
開発生産性を上げるための生成AI活用術
starfish719
3
340
株式会社 Sun terras カンパニーデック
sunterras
0
260
Advance Your Career with Open Source
ivargrimstad
0
440
Back to the Future: Let me tell you about the ACP protocol
terhechte
0
140
CSC305 Lecture 01
javiergs
PRO
1
400
Featured
See All Featured
Designing Experiences People Love
moore
142
24k
Designing for Performance
lara
610
69k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
The Power of CSS Pseudo Elements
geoffreycrofte
79
6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
2.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
How to train your dragon (web standard)
notwaldorf
96
6.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Why Our Code Smells
bkeepers
PRO
339
57k
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