0
votes

As I understand I'm supposed to overwrite the adapter for Backbone models so it it'll have different persistence strategy. But what if I need for my app to be an offline app with possibility to recache its data from the server?

How should I go about that offline caching in Appcelerator Titanium? I'm using the Alloy Framework.

Best Regards

1

1 Answers

0
votes

Backbone was designed to work with a single store per collection. Typically the store is a REST API.

In Titanium you'd want to sync to an API when online and use an offline store like a SQLite database.

To do this you'd need to sync a collection to two stores, which BB does not support.

There's workarounds for this for BB on the web: https://github.com/nilbus/Backbone.dualStorage

For Titanium this wouldn't work 1:1, but I once used the following library: https://gist.github.com/FokkeZB/e47dbc993183ec23b6699e875eb01137