Ember-Data creates many requests (instead of IDs)

After upgrading to ember-data-1.0.0-beta.9, I noticed that my app is much slower due to the large number of requests for individual items:

  • GET / api / comments / 1
  • GET / api / comments / 2
  • ...

instead of dosing them like in the .8 beta using? ids:

GET /api/comments/?ids[]=1&ids[]=2&....

      

I mistakenly thought this PR made its way to beta 9 and that I could set a parameter fetchBatchSize

in the RESTAdapter, but no ...

How can I get a similar dosing behavior in beta.9?

+3


source to share


1 answer


You must now select this behavior. See the section on coalescing request here: http://emberjs.com/blog/2014/08/18/ember-data-1-0-beta-9-released.html

Basically, add this to your code:



DS.RESTAdapter.reopen({
  coalesceFindRequests: true
});

      

+9


source







All Articles