Open-Knesset-Mobile icon indicating copy to clipboard operation
Open-Knesset-Mobile copied to clipboard

reduce the object size of data objects after fetching from server

Open gardenofwine opened this issue 13 years ago • 2 comments

all data fetched from the server is cached in memory. Therefore, it is good practice that the apiParser return the minimal object needed for display, to preserve memory. For instance, the member data returned from the server is 5 times bigger than what is actually used.

gardenofwine avatar Nov 12 '12 21:11 gardenofwine

in apiParser.js, every api call in OKnessetAPIMapping  has an 'expectedObject' field. This field denotes the fields used by the application. All the other information returned form the server is not used, and can be truncated by the parser when it returns the info to the application. For example see the function createMinimalMemberItem which reduces the size of the member object to the minimum required.

gardenofwine avatar Dec 27 '12 16:12 gardenofwine

Started working on it

romansky avatar Dec 28 '12 09:12 romansky