Flush the contents of the "Store" object


#1

We are looking at using Ember for a very large call center application. One concern we have is that the Store object contains all data retrieved from server over the life of the user’s session.

In the case where an agent is using the App for 8 hours a day, the size of the Store could grow to a huge footprint. Is there any way to Flush the DS.Store object? Ideally when the agent is finished servicing a member, we’d like to Flush the store as there’s no use in it keeping any data it retrieved for the previous member.


#2

There is an unloadAll method on the DS.Store, but you have to call it per type. So for example, in a controller or route, you could call this.store.unloadAll('phoneNumber'); to unload all PhoneNumber models.

I opened a question recently about some errors I was getting. Turns out you can’t call unloadAll during a loading state, so not from the beforeModel, model, afterModel, activate, or setupController methods of a route. I haven’t confirmed all these, but my errors turned up in the logout route’s activate hook. I think the better place to do the unload stuff is in an action handler.