
Client-Side Data Storage
Keeping It Local
Publisher: O'Reilly Media
Release Date: January 2016
Pages: 118
Read on Safari with a 10-day trial
Start your free trial now Buy on AmazonWhere’s the cart? Now you can get everything on Safari. To purchase books, visit Amazon or your favorite retailer. Questions? See our FAQ or contact customer service:
1-800-889-8969 / 707-827-7019
support@oreilly.com
One of the most useful features of today’s modern browsers is the ability to store data right on the user’s computer or mobile device. Even as more people move toward the cloud, client-side storage can still save web developers a lot of time and money, if you do it right. This hands-on guide demonstrates several storage APIs in action. You’ll learn how and when to use them, their plusses and minuses, and steps for implementing one or more of them in your application.
Ideal for experienced web developers familiar with JavaScript, this book also introduces several open source libraries that make storage APIs easier to work with.
- Learn how different browsers support each client-side storage API
- Work with web (aka local) storage for simple things like lists or preferences
- Use IndexedDB to store nearly anything you want on the user’s browser
- Learn how support web apps that still use the discontinued Web SQL Database API
- Explore Lockr, Dexie, and localForage, three libraries that simplify the use of storage APIs
- Build a simple working application that makes use of several storage techniques
Table of Contents
-
Chapter 1 A Gentle Introduction to Client-Side Data Storage
-
Chapter 2 Working with Cookies
-
Cookies? Seriously?
-
Working with Cookies
-
Demos
-
Inspecting Cookies Within Developer Tools
-
Support and Recommended Usage
-
-
Chapter 3 Working with Web Storage
-
Web Storage, AKA Local Storage
-
Working with Web Storage
-
Demos
-
Listening for Storage Changes
-
Inspecting Web Storage with Dev Tools
-
Support and Recommended Usage
-
-
Chapter 4 Working with IndexedDB
-
Welcome to Deep Data
-
Key IndexedDB Terms
-
Checking for IndexedDB Support
-
Working with Databases
-
Working with Object Stores
-
Working with Data
-
Getting All the Data
-
Even More with IndexedDB
-
Inspecting IndexedDB with Dev Tools
-
Support and Recommended Usage
-
-
Chapter 5 Working with Web SQL
-
Dead Spec Walking
-
Basic Database Terms
-
Checking for Web SQL Support
-
Working with Databases
-
Working with Transactions
-
Inspecting Web SQL with Dev Tools
-
Support and Recommended Usage
-
-
Chapter 6 Making It Easier with Libraries
-
“Use the Library, Luke...”
-
Working with Lockr
-
Simplifying IndexedDB with Dexie
-
Working with localForage
-
More Options
-
-
Chapter 7 Building a Sample Application
-
Let’s Build Something!
-
Our Sample Data
-
The Application
-
The Code
-
Wrap-up
-