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
Web Storage
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Sebastiano Armeli
March 09, 2011
Programming
170
0
Share
Web Storage
Talk given in March 2011
Sebastiano Armeli
March 09, 2011
More Decks by Sebastiano Armeli
See All by Sebastiano Armeli
Cultivate Excellence In Engineering Teams through Continuous Software Engineering
sebarmeli
1
210
From Strategy Definition to Execution with OKRs and Roadmap
sebarmeli
0
230
From Mission to Strategy: going over OKRs and Roadmap
sebarmeli
0
320
Managing a software engineering team
sebarmeli
1
650
Enforcing coding standards in a JS project
sebarmeli
0
610
Enforcing Coding Standards
sebarmeli
1
130
ES6: The future is now
sebarmeli
2
510
EcmaScript 6 - the future is here
sebarmeli
5
7.5k
Dependency management and Package management in JavaScript
sebarmeli
0
790
Other Decks in Programming
See All in Programming
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
7
2.7k
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.4k
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
11k
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
260
TSKaigi 2026 TypeScriptバックエンドのオブザーバビリティ戦略 — Datadog × NestJSの実践
taiseiyamamotoan
1
210
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
400
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
130
AI駆動開発勉強会 広島支部 第一回勉強会 AI駆動開発概要とワークショップ
hayatoshimiu
0
420
AIエージェントの隔離技術の徹底比較
kawayu
0
450
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
130
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
430
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.1k
Featured
See All Featured
Leo the Paperboy
mayatellez
7
1.8k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
160
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
550
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
For a Future-Friendly Web
brad_frost
183
10k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Transcript
Web Storage Sebastiano Armeli-Battana
[email protected]
@sebarmeli Sunday, 20 February 2011
Remote Data Storage Sunday, 20 February 2011
Why Web Storage? • Performance • Speed • Reduced load
on the servers • Offline applications • Transaction - HTTP stateless Sunday, 20 February 2011
History of Client-side Storage •HTTP Cookie • userData Behaviour in
IE 5.5 • Local Shared Objects in Adobe Flash • Google Gears Sunday, 20 February 2011
Web Storage • by WHATWG / W3C • HTML5? Actually
not... • 2 Storage Areas : • localStorage • sessionStorage • globalStorage HTML Sunday, 20 February 2011
Storage API interface Storage { readonly attribute unsigned long length;
DOMString key(in unsigned long index); getter any getItem(in DOMString key); setter creator void setItem(in DOMString key, in any value); deleter void removeItem(in DOMString key); void clear(); }; Sunday, 20 February 2011
localStorage • localStorage.setItem(“key1”, “value1”); localStorage.setItem(“key2”, “value2”); • localStorage.getItem(“key1”); // “value1”
• localStorage.length; //2 • localStorage.removeItem(“key1”); • localStorage.length; // 1 • localStorage.clear(); • localStorage.length; // 0 Sunday, 20 February 2011
sessionStorage • sessionStorage.setItem(“key1”, “value1”); sessionStorage.setItem(“key2”, “value2”); • sessionStorage.getItem(“key1”); // “value1”
• sessionStorage.length; //2 • sessionStorage.removeItem(“key1”); • sessionStorage.length; // 1 • sessionStorage.clear(); • localStorage.length; // 0 Sunday, 20 February 2011
Storing Objects • Key/value pairs • Value is a STRING!
• Stringify / Parse JS Objects • JSON.stringify(myObject); • JSON.parse(myString); Sunday, 20 February 2011
Storage Event • “storage” event • Triggered when Storage Areas
change • Binded on Window • Attributes: • key, • oldValue • newValue • url Sunday, 20 February 2011
Support • IE 8+ • FF 3.5+ • Safari 4+
• Chrome 7+ • Opera 10.6+ • iOS Safari 4.0+ / Android 2.2+ Sunday, 20 February 2011
JS Utilities • YUI2 Storage • Dojo Storage • PersistJS
Sunday, 20 February 2011
Advantages (over Cookies) • Saving Bandwith • Size • Sessions
not leaking • Network sniffing Sunday, 20 February 2011
Limitations • 5 Mb (or 10Mb) • “QUOTA_EXCEEDED_ERR” • “SECURITY_ERR”
• Storage per origin • Cross directory attacks -> DO not USE it! • DNS Spoofing -> SSL Sunday, 20 February 2011
The future of Web Storage • Store data that rarely
change • Mobile Sites • Offline apps • More Storage? Index Database API Sunday, 20 February 2011
Thank you. Sunday, 20 February 2011