Javascript – Storing information locally

 

I’ve been doing some research for Ink into the best way to store information locally on the client (to survive a browser restart).

While localstorage is more or less ubiquitous, the main issue for me is that the maximum storage is around the 2.6 million character sort of area for Chrome (test your current browser – here). Normally, that would be fine for most web sites, but with Ink – I’m going to be storing whole novels locally – along with notes, comments, pinboards, images and all other kinds of shenanigans.

In order to do that – I’m going to use indexedDB. For the browsers where there’s no IndexedDB (I’m looking at you, Safari) – I’m going to use a polyfill to mirror the functionality on Web SQL. Between the two – all of the main desktop browsers are covered – along with many of the major mobile ones (except Opera Mini).

The downside for both of those is that the browser will ask the user for permission to store data. I’m okay with the user realising that information is going to be stored locally, as it’s a key part of Ink – the ability to work offline.

So. For Ink – IndexedDB it is, then.

(Sorry, Opera mini – but if there’s no way for me to store large amounts of text on you – then no Ink.)