In doing a Api,app end want to extract the brief data to cache on the phone side, so designed an interface to provide to the app to pick up,
After testing, the JSON format of the packet around 2M (as thin as possible and do the serialization process), resulting in a response time of about 10 seconds, this is not ideal, but also try to get too much page, but this increases the number of connections, is not ideal, decided to use one time to get the solution, so I would like to ask how to optimize the output of this data, such as the title mentioned in the timely output, but did not get past I am not sure whether this can guarantee the legitimacy and operability of JSON data. Suggestions are also welcome if there are other options.
Reply content:
In doing a Api,app end want to extract the brief data to cache on the phone side, so designed an interface to provide to the app to pick up,
After testing, the JSON format of the packet around 2M (as thin as possible and do the serialization process), resulting in a response time of about 10 seconds, this is not ideal, but also try to get too much page, but this increases the number of connections, is not ideal, decided to use one time to get the solution, so I would like to ask how to optimize the output of this data, such as the title mentioned in the timely output, but did not get past I am not sure whether this can guarantee the legitimacy and operability of JSON data. Suggestions are also welcome if there are other options.
Did you go back to the test with Redis or Memcahce?
This situation try gzip may have unexpected effect
If it is an efficiency problem to generate data, it is recommended to find a caching scheme
Now that you've used the app, use the app-side computing power
Request binary data back from the server, this data performs text compression-text compression is amazing oh, especially formatted data
Extract the data back to the JSON format after you have obtained it locally
JSON field name both parties agreed, as short as possible ~ ~ ~
Subsequent requests to obtain incremental or changed data can be
Compress, use MD5 to ensure file integrity, use GET request if business allows.