Collection usage in BackboneJS
Which is better to use the collection:
Collection contain the total list of data, and include a function to select the the part of data show in view. Lots of data should be loaded in client side.
Collection only 开发者_高级运维contain the data to show in view. In this way, require to fetch data from server more frequently. And the data to show in view is selected on server side.
Any suggestion?
It depends on the size and sensitivity of the collection, but in general I preference proxying requests to the server-side, and storing only the view/cache data locally. It will serve better in the long-run.
If you have tonnes of data, best solution will be to load it on demand.
精彩评论