Ember-data - block data caching

Hi, i’d like to use Ember-data in my project, but my project has additional library, which communicate with backend and cache data. I know that i can force refresh in ember-data and always fetch fresh data, but i am wondering is there possibly to block caching data in ember store? I am not sure but, if i keep data in my lib and ember-data keep same data in the store, my app will be slower. I ll be greateful for any answer. If using ember-data is wrong in this case, I ll be greateful for explanation.

The store is fundamental to how ember data works.

It sounds like you shouldn’t be using ember data for your use case.

But there’s no reason you couldn’t use ember data and use an adapter to commuicate with your library instead.

@alexspeller i know that i can adjust ED to my lib, but If you do, what will be the advantages? My lib is something like store, so if I force reload in ED, I will always keep last copy of data in ED store and i never use that becouse i force reload every time.

Isn’t it better create Ember.Object --> (Model) and normalize response from my lib and forget about ED? I see only additional caching data and project will look a little better.

Ember data provides a lot of stuff that you would otherwise need to write for yourself. Relationships, dirty-tracking, serialization / deserialization, async handling, error handling.

Only you can know how much of that you need in your app and if it’s worth using or writing your own solution instead. Have a look at the guides on the ember site to see how much of it you need and how much you’re willing to write yourself instead.

1 Like