How can I store things on the browser?
The traditional web browser is a “thin client” which interacts with a web server. The user’s virtual shopping trolley is kept on the web server, and the browser gets/sets it with HTTP requests. But today’s browsers support “fat” clients; web applications can store state on the local browser. There are lots of ways to store this state! Let’s look at some of them:
Storage type | Appeared | Deprecated? | Support |
---|---|---|---|
HTTP Cookies | 1994 | No | ~100% |
LocalStorage | 2009 | No | 94% |
SessionStorage | 2009 | No | 94% |
IndexedDB | 2010 | No | 92% |
CacheStorage | 2013 | No | 73% |
WebSQL | 2009 | Yes, 2010 | 83% |
AppCache | 2009 | Yes, 2015 | 93% |
Tagged . All content copyright James Fisher 2017. This post is not associated with my employer.