App development Combat 120-app network traffic optimization

Source: Internet
Author: User
Tags json
30.2 network traffic optimization

1 At present, users are basically downloading the app through the network and updating the app version, reduce the size of the app, you can effectively reduce user consumption of network traffic.

2 at present, the league has supported the incremental upgrade app features, so that even if the app has 10M size, but if the changes are only 10K, using the incremental upgrade feature, users only need to download 10K of data, you can implement the upgrade version of the app. It is best to use the incremental upgrade feature to update the APK.

3 when transferring data from the app and server, the data in small data format, such as JSON format, is smaller than the amount of data in XML format, and the amount of data in protobuffer format is smaller than that in JSON format.

4 the application side to minimize the number of times to send requests to the server side, the interface can be merged to merge as much as possible, each request, both sides need to send at least one HTTP header field data, if the connection is broken, but also multiple and the server handshake process, these will consume more network traffic.

5 The data structure of each interface of the app side and server side is as simple as possible, and the content of each field is as short as possible; When the server transmits data to the app, it transmits only the data that the app uses, the useless data does not pass to the app, not only can reduce the traffic consumption, but also can reduce the time of the app's parsing

6 The server to pass the image data to the app side, it is best to use JPG format pictures, while the image compression to the app side of the required size, and then passed to the app side, not only can reduce traffic consumption, but also reduce the memory used to parse the image.

7 using the caching mechanism to get data from memory or local storage, you do not need to fetch data from the server every time.

8 In addition to the app's own upgrade with an incremental upgrade, the app uses a data update that also uses an incremental upgrade approach to reduce the amount of network traffic consumed. As many apps have a national administrative address data, all of the address data is very large, but each change in the data is very small, you can only from the server to obtain the change part of the data, thus effectively reducing the consumption of network traffic.

9 when the server transmits data to the app, it's best to use gzip format, which is compressed and then passed on to the app to reduce data traffic.

10 in the case of 2G network, the server can pass the low quality picture to the app, or let the user select No Picture mode on some pages to reduce network traffic.

11APP download files from the server or upload files to the server, you should support the extension of the breakpoint, you can reduce the number of repeated network traffic consumption.

12 If the application and the server real-time data transmission requirements are not high, carefully use long connection; Long connections require both parties to continuously send link detection packets to maintain the connection state, which also consumes network traffic.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.