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
Sebastiano Armeli
March 09, 2011
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
220
From Strategy Definition to Execution with OKRs and Roadmap
sebarmeli
0
240
From Mission to Strategy: going over OKRs and Roadmap
sebarmeli
0
320
Managing a software engineering team
sebarmeli
1
660
Enforcing coding standards in a JS project
sebarmeli
0
620
Enforcing Coding Standards
sebarmeli
1
140
ES6: The future is now
sebarmeli
2
520
EcmaScript 6 - the future is here
sebarmeli
5
7.6k
Dependency management and Package management in JavaScript
sebarmeli
0
790
Other Decks in Programming
See All in Programming
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
220
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
260
どこまでゆるくて許されるのか
tk3fftk
0
500
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
6.4k
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.2k
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
110
Foundation Models frameworkで画像分析
ryodeveloper
1
120
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
140
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
250
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
170
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
860
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
510
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Why Our Code Smells
bkeepers
PRO
340
58k
Being A Developer After 40
akosma
91
590k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.4k
A Soul's Torment
seathinner
6
3.1k
Agile that works and the tools we love
rasmusluckow
331
22k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
770
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.7k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
610
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
460
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