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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Sebastiano Armeli
March 09, 2011
Programming
0
170
Web Storage
Talk given in March 2011
Sebastiano Armeli
March 09, 2011
Tweet
Share
More Decks by Sebastiano Armeli
See All by Sebastiano Armeli
Cultivate Excellence In Engineering Teams through Continuous Software Engineering
sebarmeli
1
190
From Strategy Definition to Execution with OKRs and Roadmap
sebarmeli
0
190
From Mission to Strategy: going over OKRs and Roadmap
sebarmeli
0
310
Managing a software engineering team
sebarmeli
1
640
Enforcing coding standards in a JS project
sebarmeli
0
610
Enforcing Coding Standards
sebarmeli
1
130
ES6: The future is now
sebarmeli
2
500
EcmaScript 6 - the future is here
sebarmeli
5
7.4k
Dependency management and Package management in JavaScript
sebarmeli
0
770
Other Decks in Programming
See All in Programming
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.5k
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
510
The free-lunch guide to idea circularity
hollycummins
0
270
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
220
AI 開発合宿を通して得た学び
niftycorp
PRO
0
150
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
320
Understanding Apache Lucene - More than just full-text search
spinscale
0
130
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
660
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
400
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.1k
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
120
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
300
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
160
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
490
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Music & Morning Musume
bryan
47
7.1k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Design in an AI World
tapps
0
170
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Paper Plane (Part 1)
katiecoart
PRO
0
5.7k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
150
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
Faster Mobile Websites
deanohume
310
31k
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