This project is a fork of Backbone dualStorage Adapter by lucian1900 https://github.com/lucian1900/Backbone.dualStorage.
Fetch Cache is a plug and play extension for Backbone Collections that let your application access cached content of a URL until the TTL is expired.
This project is based con Backbone dualStorage. All requests are stored in localStorage for off-line access. This plugin use it for caching, keeping cached-content updated even when you create update, or delete models of a collection. For more information on using dualStorage plugin, please refer to https://github.com/lucian1900/Backbone.dualStorage.
Include Backbone.dualStorage:
<script type="text/javascript" src="backbone.js"></script>
<script type="text/javascript" src="backbone.dualstorage.js"></script>
If you want to use cache:
Collection = Backbone.Collection.extend({
cache: {
ttl: 30
}
});
Thanks to Jerome Gravel-Niquet for Backbone.localStorage.
Thanks to lucian1900 for Backbone.dualStorage