If all html data is transmitted in json format, will browser be much faster? -

Source: Internet
Author: User
Tags closing tag
If all data is transmitted in json format, browser will be much faster, because no closingtag (xmlorhtml) is available. How can this problem be solved? If all data is transmitted in json format, browser will be much faster, because there is no closing tag (xml or html). How can this problem be solved? Reply content: will the browser be much faster? What is the next step? Is transmission fast or resolution fast?

If it means fast transmission, the closing tag does have a waste of space in terms of information redundancy. It makes sense to replace it with json or other formats.

However, we can compress the http body, And gzip can control the overhead syntax with one press. So even if you change the HTML, it will not be much faster at the transmission level.

Another advantage of HTML over json is the high indexing rate, which does not affect the loss of one or two tags. However, if json is used, dropping one double quotation mark is likely to throw the entire response. HTML is much more readable than json.

You see, simply changing HTML to json for a less influential closing tag will only result in a minimal increase in transmission efficiency and the loss of watermelon. @ Lu Xiaofu answered very well. For issues other than speed, the subject can also refer to why Web Front-end development does not abandon HTML and CSS and is developed with pure JavaScript? -Front-end development should not be based on strings if it really wants transmission efficiency. Both HTML and JSON are based on strings. You don't need to use the app, and you don't need to use the interface. Basically, there is almost no difference in json transmission. If you use json, it may be slower on devices with lower performance.

The dynamic content in the itunes PC version is transmitted in binary xml. Do you feel fast?

Why? Because the close tag is for developers to see, in actual transmission, professional web servers are compressed to the page gzip.

If it is faster, we should try to reduce HTTP requests. Therefore, SPDY is designed based on this idea. Directly transmitting the compressed binary stream is the fastest ...... Directly connect an image, style sheet, Font, and HTML together, and press the package one more ...... Try to use angularjs for development. As long as you load an oversized homepage and transmit all other json files, the programming language is very good for other answers to humans, the problems that the subject cannot ignore also include the loss of direct use of html text, and the disadvantages of complicated model development. These are important issues that cannot be ignored in the company.

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.