The current mode of M-station development, still request the full HTML, so that the problem is the amount of data per request too much, in the absence of WiFi, resulting in a slow page opening, the consumption of traffic is more; Access M station is mobile device, its browser version is higher, So its HTML5 attribute Localstorage support is also good, and the M station page is relatively simple, the structure is better, if the use of Localstorage+js analytic template +json data way to achieve m structures, its access speed should be greatly improved.
The specific implementation is as follows:
1. The HTML node of the page is stored in the Localstorage, because the M station structure is simple, the main points of the page is basically home/Channel page/category page/Search results page/Product Details page/booking page, and the page itself is relatively simple, so the overall data volume will not be large
2. When the page is accessed, the background pushes the JSON data, and then uses the JS Template parsing tool to assemble the JSON with the data in the Localstorage and populate it in the page
If implemented in this way, when the page is accessed, the amount of data returned is very small, with only one JSON object.
Pros: Small amount of data returned, page open speed block
Cons: not conducive to page SEO
Using Localstorage and JS template engine to develop M station idea