简体   繁体   中英

Backbone.Collection Prefetching & Caching

Are there any recommended libraries, patterns or examples on how to implement Prefetching and/or caching on a Backbone.Collection ? For example, I have events I want to display in a calendar that has different view modes (eg. Day, Week, Month). I think it will be better to query the database/API once for say 1-3 months at a time to avoid too many network requests, even if I am in week view.

Then I think its beneficial to cache the received data (when the user constantly paginates, it will be faster), which is easy, but I will also need to somehow determine what to clear and at what point. In PHP there are PHP APC, XCache etc was wondering if there something similar in JS. Or do I do that on server side? For work, its a Java server, but I am also interested in NodeJS nowadays

This might answer some of your questions. Collection of good practices for building backbone applications and the pitfalls you should avoid. Grouped according to the topic (Models, Views, templating ... )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM