I’ve been dealing with this on my company’s application recently. Most of our users are viewing the app on a mobile phone, and they are often in building basements with spotty WiFi.
There’s a fork of rack-offline that works reasonably well with Rails 4: https://github.com/pascalw/rack-offline
I’ve also been using jquery-offline to cache API responses: https://github.com/wycats/jquery-offline
jquery-offline has a really cool system for working with cached content, but yesterday we found a bug with it where bad server responses can sometimes result in garbage data getting stuck in the cache. I spent most of yesterday rolling my own new version of the library, and I’m hoping to open-source it after a couple weeks of evaluation. One other potential issue with jquery-offline is that it uses the old style of jQuery Ajax responses (no promises), so it’s hard to construct clean callbacks with it the way you can with jQuery’s deferred/promise system (implemented in 1.5 or 1.6)
Both rack-offline and jquery-offline, which are written by the famous and very smart Yehuda Katz (of Rails, jQuery, Ember, and Skylight.io fame), have a significant attached risk, which is that now that Yehuda has moved on to Ember, both libraries haven’t been updated in over 18 months. I think this is a bigger problem with jquery-offline than rack-offline (which as long as you’re using the Rails 4 branch seems to work well), but it’s important to know that if you encounter issues it’s likely going to be up to you to fix them.
Let me know if you find anything in your own research, as this is a problem we’re thinking about a lot right now at my company.