Christian Heilmann

Do HTML5 apps have to be online all the time?

Sunday, March 23rd, 2014 at 3:28 pm

One would think that almost five years after the definition of HTML5 offline capabilities this question would be answered. As someone spending a lot of time on HTML5 panels and Q&A sessions at conferences I can tell you though that it gets asked every single time.

being offline

As part of the App Basics for Firefox OS video series we recorded a very short video that shows that HTML5 apps totally can work offline:

You can see the demo explained in the video in action here: non-offline version and offline enabled version.

So here it is: No, HTML5 apps don’t have to be online all the time, they do work offline if you write them the right way.

“But, but, but, but, but…”, I already here people go, “it is not that simple, as there are lots of issues with offline functionality”.

Yes, there are. Appcache is a less than perfect solution, as researched in-depth by Jake Archibald and published in non-minced words almost 2 years ago. There are also issues with localStorage being string based and synchronous and thus being less than optimal for large datasets. For larger datasets the issue is that indexedDB is not supported by all browsers, which is why you need to duplicate your efforts using WebSQL or use an abstraction library instead.

But: these are not insurmountable issues. I am very happy to see offline first becoming a UX starting point, I am super excited about discussions about replacing AppCache and the ServiceWorker proposal showing a much more granular approach to the issue.

For an in-depth showcase how offline can really work, check out Andrew Bett’s 2012 Full Frontal talk.

The problem is that these are details that don’t interest the business person considering using HTML5. All they hear is experts complaining and bickering and saying that offline HTML5 doesn’t work. Which isn’t true. It doesn’t work perfectly, but nothing on the web ever does. Many, many things in Android and iOS are broken, and many apps don’t work offline either. These shortcomings are not advertised though which makes native apps appear as a much more reliable alternative. We should stop showing our behind the scenes footage as a highlight reel.

I really, really want this question to not show up any longer. The documentation and proof is out there. Let’s tell people about that. Please?

Share on Mastodon (needs instance)

Share on Twitter

Newsletter

Check out the Dev Digest Newsletter I write every week for WeAreDevelopers. Latest issues:

Dev Digest 145: ⌨️ The best IDEs 🥷🏼 the fight for JS ✊🏽 OSS success

Advent calendars, Ode to free software, how to staet an OSS company and a a truly rocking license.  Join us on the AI and Webdev event 10/12

Dev Digest 146: 🥱 React fatigue 📊 Query anything with SQL 🧠 AI News

Why it may not be needed to learn React, why Deepfake masks will be a big problem and your spirit animal in body fat! 

Dev Digest 147: Free Copilot! Panel: AI and devs! RTO is bad! Pi plays!

Free Copilot! Experts discuss what AI means for devs. Don't trust containers. Mandated RTO means brain drain. And Pi plays Pokemon!

Dev Digest 148: Behind the scenes of Dev Digest & end of the year reports.

In 50 editions of Dev Digest we gave you 2081 resources. Join us in looking back and learn about all the trends this year.

Dev Digest 149: Wordpress break, VW tracking leak, ChatGPT vs Google.

Slowly starting 2025 we look at ChatGPT vs Google, Copilot vs. Cursor and the state of AI crawlers to replace web search…

My other work: