ese-unibe-ch / ese2013-team5

3 stars 4 forks source link

Too many single requests to the Server/API #49

Closed exside closed 10 years ago

exside commented 10 years ago

The app makes 11 requests to the API on each startup, that is basically really bad for perfromance and also for the poor server (when 100 or more people would use the app)...I already adapted the api to basically return all the info at once, I'll show you how...It returns the mensas AND all the menus for the current week, so we could reduce the requests probably to 2 or 3, but the model needs to be adapted for that.

PlekszyGladz commented 10 years ago

I think we should wait changing this until we actually have a good working version with caching and a solid code base... Refactoring this AFTER that should then not be too difficult.

PlekszyGladz commented 10 years ago

The new loading with one request looks great. What does this request return when the current week menus are not yet online? Is the menu JSON array empty? (If yes then the app will just load the last week menus from the database...)

exside commented 10 years ago

I think so (empty array of menus, inside the mensaarray, that could be a problem hm? I could change the API to return just the last week of menus if there are none...I actually made it completely independent of the original api, found a parseable datasource other than pdfs =D)

PlekszyGladz commented 10 years ago

No the empty JSON array shouldnt be a problem, it would just trigger the loading of the local data... And the independency from the original api is great news (may I ask what the new data source is?)

exside commented 10 years ago

If no data present for current week, the API automatically returns the data for the last week (menus), this is fixed so far.