3 ms·
This issue is very much considered. You absolutely don't use this to make a bunch of tiny little Ajax requests to load your application in pieces. Instead, you
by jashkenas 16y ago
This issue is very much considered. You absolutely don't use this to make a bunch of tiny little Ajax requests to load your application in pieces. Instead, you bootstrap all of the data you need for an initial load onto the page, and then populate the collections directly.
For saving, a single update often needs to be a single request, and the UI needs to know that the update has been applied successfully. If you need to do a bulk update, then use "set", not "save", and make a custom Ajax call for the bulk operation.
Finally, Backbone.sync is the lowest-common-denominator default REST request, which will work for many applications. You can and should override it if you have more specific needs -- using timeouts to aggregate many granular saves into a single HTTP request is a great idea for some applications...