3
votes

After upgrading to ember-data-1.0.0-beta.9 I noticed my app was running a lot slower due to making many requests for individual items:

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

instead of batching them as in beta.8 using ?ids:

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

I mistakenly thought that this PR had made it's way into beta.9 and that I could set the fetchBatchSize param on the RESTAdapter, but no...

How can I get similar batching behavior in beta.9?

1

1 Answers

9
votes

You have to opt into that behavoir now. See the section on request coalescing 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
});