To make the whole thing completely available offline is insanely easy, and reusable to boot.
MY WORKSHOPMaster Next.js
Everything you need to master universal React with Next.js in a single intense master class. Includes full pass to ffconf, the web developer conf.
The first step is to add the
manifest attribute to the
In this case we've got a file called
self.manifest which is pretty simple. It contains the following:
Yep, that's it. Since the application cache automatically includes the file that references the manifest file, we've now got an offline application cache for our single file app.
Make sure you're serving the manifest file correctly, if you're not sure, check out the HTML5 Doctor introduction to offline applications, but otherwise, that's it.
When I went away this last week, I wrote a little Boggle clone, and wanted it work offline on the plane - so I added this technique to the single file app (it's only the board and a countdown, not interactive).
Dirt simple, but totally reusable!