Hi all,
I am hoping for some advice around data-fetching strategies in an ember-data app.
What are the advantages/disadvantages and tradeoffs between the following two strategies:
- Server fetch on route transitions - e.g.
this.store.findAll('post')
onindex
routes andthis.store.findRecord('post', id)
onshow
routes. - Cached data strategy - e.g.
this.store.findAll('post'
) in theApplicationRoute
, withthis.store.peekAll('post')
in any route that needs the data (this.store.peekRecord()
if only need a single item).
What is more common? Why? What is the disadvantage of using the peekAll
strategy, and keeping all lookups on the client?