A few weeks ago I spoke at Nationjs about "Responsive is Over, Offline First." Raymond Suelzer @RSuelzer asked "Any recommendations on handling the 5mb limit in local storage?"
Constrains are a positive in design. So the question is when working on an offline first sites how to think about the storage limit of local storage. This can be as low as 5MB.
First, even 5MB can be considered a lot of memory. The Apollo computer that got man on the moon had only 16k. So think positively about local storage.
Second, local storage is not your only option. Depending what you are trying to store, application cache is a good alternative. It does not have a great reputation but it is worth considering especially for images and some other files.
Third, your application, data or content may exceed the storage limit, that does not mean it cannot work offline. There are many different types of offline use cases.
One case is a website of content. No interaction and no syncing of data back to the application. Pouchdb's current site is a case in point. I recently accessed the site and then got on a cross country flight with no internet access. I navigated from page to page with no trouble.
Another case is interaction with poor connectivity. Think of turning on and off Airplane Mode as you use the app. The user experience is good so long as the input is not lost and synced when a connection is reestablished. It would be a rare case when the input exceeds the storage limit. While the user may not be able to access the entire site when offline the data is safe.
Another approach is to consider your app as having two different modes: offline and online. Write the app as an offline app first with enhancements when online. For example, if you app shows a photo gallery, perhaps that feature is only available when online.
There are lots of different approaches to offline first besides being a 100%, stand alone app when offline.
No comments:
Post a Comment