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
Ionic+PWA対応サイトのLighthouseスコアを34から81まで上げる話
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
scrpgil
May 20, 2018
Programming
1.2k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ionic+PWA対応サイトのLighthouseスコアを34から81まで上げる話
Ionic Meetup Tokyo #4(2018/05/20)にてLTした資料です。
スコアアップを図ったWebサイトは以下。
https://aahub.org
scrpgil
May 20, 2018
More Decks by scrpgil
See All by scrpgil
Firebase Realtime DB から ActionCable 移行のマネジメントの話
scrpgil
0
130
フレーム問題で考えてみるやる夫スレViewer
scrpgil
0
180
ChatGPTとLangChain さわってみた
scrpgil
0
130
久しぶりに ionic startしてみた
scrpgil
0
280
Ionic 6でWeb3やってみた
scrpgil
0
250
Ionic×Angularで作る ストーリーズ風UI
scrpgil
0
490
Angularで作るモバイルアプリ開発〜スタートアップの開発事情〜
scrpgil
0
730
夢のクロスプラットフォーム開発
scrpgil
0
410
Stencil JSについて
scrpgil
0
470
Other Decks in Programming
See All in Programming
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
100
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
180
[2026-10-09]一枚の布で作らなくてもいい。 信頼性は「パッチワーク」で紡がれる~既存の運用と新しい可能性をつなぎ合わせてきたCREの話~
tosite
0
110
気持ちぃ〜角丸 Squircle
ryu1013
0
320
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
160
Next.js: The final boss of Web Performance
guaca
0
310
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.7k
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
300
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
[2026-10-14](C)Re:ゼロから始める異世界生活〜始まりの終わりと終わりの始まり〜
tosite
0
140
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
170
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
270
Featured
See All Featured
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
310
GraphQLとの向き合い方2022年版
quramy
50
15k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Test your architecture with Archunit
thirion
2
2.4k
Technical Leadership for Architectural Decision Making
baasie
3
610
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Transcript
Lighthouseのスコア (パフォーマンス)を 34→81まで上げる Ionic Meetup Tokyo #4 @xiaca
前段
前回名古屋のIonic Meetupに参加した時 Lighthouseを知りました
さっそく自分のサイトを計測してみたら 34点しかありませんでした。
さっそく自分のサイトを計測してみたら 34点しかありませんでした。 これはよくない
Lighthouseのスコア (パフォーマンス)をあげよう
削減したサイト 参考:https://aahub.org 概要: AAのオンラインビューアー Ionicで作成したPWA対応のサイト 特徴: 画像を使用していない カスタムフォントを使用している
まずは、CSSの削減。 参考 https://julienrenaux.fr/2017/07/20/optimized-ionic-angular-css-bundle-for-pwas/ 580Kb main.css
iOS、WindowsPhoneのCSSは捨てる ・ionic-app-scriptのconfig/sass.config で設定 ・IonicModule.forRootでmodeをmdだ け読み込むように変更 580Kb→290Kbまで削減 ・node_modules/@ionic/app-scripts/config/ sass.config.js ・src/app/app.module.ts
themeのcolorsは使わない ・ひとつ消す毎に14Kbくらい削減 ・color属性は使わずcssで記述する ように変更 290Kb→198Kbまで削減
使わないコンポーネントのCSSを削除 ・とくにgridは削除すると30KB削減さ れるので狙い目 ・node_modules/@ionic/app-scripts/config/ sass.config.js 198Kb→100Kbまで削減
purify-cssを使った ・不要なCSSを削除してくれるツー ル 100Kb→70Kbまで削減
34→56まで改善した
34→56まで改善した この調子
カスタムフォントから漢字グリフを削除 1.4Mb→45Kbまで削減 ・AAに漢字は不要 ・漢字は等幅なのでAA表示に影響なし 亻人艹丁十 間凧越蟹願
カテゴリ一覧の構造体を別ファイル化 ・カテゴリ一覧を表示するための構造体情報を埋 め込んでいたけど、jsonファイルにして別読み込 みするように変更 1.1Mb→120Kbまで削減(main.js)
56→69まで改善した 体感レベルでは相当早くなってきた
56→69まで改善した 体感レベルでは相当早くなってきた もうひとおし
ioniconsの削除 ・必要なiconだけ読み込むように変更 ioniconの読み込みが不要に
HTMLを削減 ・buttonとかをngForで描画するように変更 10Kb削減(main.js)
CSSをインライン化 ・ionic build --prod後のmain.cssをindex.html に移植 RenderBlockingStyleSheetが改善(810ms→0ms)
69→76まで改善した ついに表示が緑色(オールグリーン)に
69→76まで改善した ついに表示が緑色(オールグリーン)に が、しかし
ここから先は何をやっても変わらない... • httpClientをaxiosにしてみる • CloudFlareを使ってみる
最後 環境を変えてみた
ゲーミングPCと有線LANの環境で測定 ・中国から輸入したゲーミングPC CPU: Intel Core i7-7700 Quad Core 3.6GHz メモリ:8GB
DDR4 RAM SSD:Colorful SL500 240G Hard Disk
81を超えた!
Ionic v4への期待 • Ionic-angular(310Kb)の軽量化
引き続きスコアアップを目指します
None
以上、 ご清聴ありがとうございました。