What is the difference between localForage and localStorage

LocalStorage API is synchronous and accepts simple key value strings.

LocalForage leverage this simple interface with Promises to get/set values and gives the ability to store more than converted strings as data.

If you are familiar with the logic of LocalStorage and you are experimenting with something new I suggest you give it a try.

Reference: http://blog.teamtreehouse.com/using-localforage-offline-data-storage


The benefits of LocalForage appear to be that it uses IndexedDB (with fallback to WebSQL or LocalStorage) as the storage backend. This allows it to be faster as well as not blocking execution of other code on long operations as it's API uses asynchronous promises. It also supports storing more than just strings unlike LocalStorage.

This is a good overview of LocalForage: https://hacks.mozilla.org/2014/02/localforage-offline-storage-improved/