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
Take care to invalidate Client Side Storage
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
shinichi.kogai
September 30, 2019
Technology
1
240
Take care to invalidate Client Side Storage
shinichi.kogai
September 30, 2019
Tweet
Share
Other Decks in Technology
See All in Technology
Databricks Free Edition講座 データエンジニアリング編
taka_aki
0
2.7k
20260114_データ横丁 新年LT大会:2026年の抱負
taromatsui_cccmkhd
0
370
GitHub Copilot CLI 現状確認会議
torumakabe
12
3.8k
20260120 Amazon VPC のパブリックサブネットを無くしたい!
masaruogura
2
160
それぞれのペースでやっていく Bet AI / Bet AI at Your Own Pace
yuyatakeyama
1
440
「AIでできますか?」から「Agentを作ってみました」へ ~「理論上わかる」と「やってみる」の隔たりを埋める方法
applism118
3
980
エンジニアとして長く走るために気づいた2つのこと_大賀愛一郎
nanaism
0
210
AWSと暗号技術
nrinetcom
PRO
1
110
新規事業 toitta におけるAI 機能評価の話 / AI Feature Evaluation in toitta
pokutuna
0
190
OCI技術資料 : OS管理ハブ 概要
ocise
2
4.2k
ファシリテーション勉強中 その場に何が求められるかを考えるようになるまで / 20260123 Naoki Takahashi
shift_evolve
PRO
2
190
一番人に近いコードレビューア CodeRabbit
kinopeee
0
100
Featured
See All Featured
Leo the Paperboy
mayatellez
4
1.3k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
71
Tell your own story through comics
letsgokoyo
1
790
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
150
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
The SEO identity crisis: Don't let AI make you average
varn
0
55
Embracing the Ebb and Flow
colly
88
5k
Ethics towards AI in product and experience design
skipperchong
2
180
Into the Great Unknown - MozCon
thekraken
40
2.2k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
210
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
190
Transcript
Take care to invalidate Client Side Storage
自己紹介 • フロントエンドエンジニア(元デザイナー) • Feedforce Inc. 所属 • ECサイト運営支援SaaS •
言語処理系・型システムに興味あり GitHub: kogai Twitter: iamchawan Hatena: kogainotdan
今日話すこと • All app URLs load while offline • First
load fast even on 3G PWAの構成要件としてのClient Side Storage https://developers.google.com/web/progressive-web-apps/checklist 良さそう、でもちょっと待って
事例1 • Feedforceで運営している、とあるブログ(WordPress) • 「PWAモード」を提供するWPプラグインでオフラインモード・低遅 延なコンテンツ配信を導入 • WordPressサーバが生成したHTMLをServiceWorkerで CacheStorageに保存 •
オフライン時はCacheStorageからコンテンツを取得 • サーバ側でコンテンツに更新があれば、新しいServiceWorkerファ イルが生成されて、unregister/registerした上でキャッシュを更新 オフラインでも読めるブログ
事例1 • ServiceWorkerとCacheStorageを使っていることを認識していな いことで、「ブログを更新してもしばらく最新のコンテンツが反映さ れない」という問題が生じていた(ServiceWorkerのライフサイク ルを把握していなかった) • 「PWAモード」を停止すると、ServiceWorkerファイルの再生成が 行われなくなるので、unregister/registerもされなくなる •
「PWAモード」停止前のコンテンツが残り続けることになり、ブロ グ読者から見てコンテンツが更新されないようになる 問題点
事例2 • React-Reduxを使ったSPA • redux-persistというライブラリでLocalStorageにStoreを永続化 • 次回起動時に状態を引き継ぐ • 入力途中で離れたユーザに、CSが接触した時に直前の状態から再開 出来る
Storeをローカルに保存するアプリケーション
事例2 • StoreのShapeを変えると意図しな い動作をし得る • 型上は安全 • クライアント側アプリケーションの バージョニングの仕組みなどで、破 壊的変更をケアする必要がある
問題点
まとめ • Client Side StorageによるUXの向上は魅力的 • 但しClient Side Storageは本質的にサイト・アプリケー ションの運営者側に操作権のないストレージ
• Create/Readに関する記事は豊富だが、Update/Delete に関しても意識を向けておく必要がある
ご清聴ありがとうございました