Discussion on the feasibility of page Peer-to-peer technology based on HTML5 caching

Source: Internet
Author: User

Peer-to-peer technology, in the sharing of large files (you know) is now indispensable technology, now people, it is hard to imagine in the Internet without this thing early, how people are difficult to survive. Think of that year, do not say the film, the next a slightly larger file, are very laborious things.

Later Niu Cohen, invented Peer-to-peer technology, see here "science and Technology Hero biography" BitTorrent technology father: Cohen

Peer-to-peer technology invention, its Internet bandwidth accounted for more than 70%, see the power of this technology, the network how fast, how fast to share, speed is not in the terminal or server restrictions, but by the network, that is, the road restrictions. Truly return to the nature of the web.

As programmers, we often worry about a problem, is performance, how to let the server support more people, more access traffic. This is a big problem.

We look at traditional solutions, constantly improve the concurrency of servers, using server caching, using large data, using a distributed database, using a CDN, adding a CPU, adding memory, adding bandwidth, limiting the number of users, and so on. These means are palliative, central or sub-center mode, no matter how, ultimately there are problems, this is not a network model. This is the same as buying tickets, all run a place to buy, and then fast ticket-grabbing software is also useless.

So, is it possible, like Peer-to-peer, to the Web page also to peer-to-peer it. From the principle point of view, actually is feasible.

The principle is this, for example, when I visit this page, so the data is in my browser, but, my browser content can be shared ah, through Peer-to-peer technology, other users to share the same time between the same page content, and Peer-to-peer principle, the same page access more people, then the faster.


If someone can get the page Peer-to-peer technology, then the world will be changed again, any page, can support all the world's traffic. From this site is no longer afraid of large users, the more users, the faster the site, just and now the model is the opposite, we no longer need to optimize the site.

But such a basket of solutions can not be done. Is there anyone who can get it out? It works in principle, but it's actually very difficult. The reason is that many pages are not just static content, but the pages are complex, text, data, pictures, and even video.

But part of the solution is still some, such as cloud services, the image, video, etc. on the third party, CDN Services, put some common code to the third party, as well as web-accelerated services, such as what number of popular plans to speed up the site cache.

Of course, these solutions are very cumbersome and expensive things, the best is the browser support itself to support the Web Peer-to-peer, but this technology does not look like these years, as an entrepreneur or SME website, there is no cheaper way to solve performance problems.

This allows you to use some of the HTML5 advanced technology, HTML supports local storage, and local caching, but for dynamically loaded pages it may also need to be encoded further, if we put stylesheets, code, generic data, pictures, after the first load, then script the local database, Of course, this requires a version management technology.

In this case, in addition to the first slow, later because a large number of content is cached to the local, then the Web application is somewhat similar to the traditional C/s application. Server-side pressure is greatly mitigated.

However, the user has more than the server or the same performance problems, can be in a customer cache local data, B customers visit the site, directly to a customer, Guide B customers, let a customer obtain B customer's cached data.

The answer is yes, but not now, the consortium is developing Peer-to-peer browser standards that allow your browser to communicate with his browser in real time without having to go through a server, which can be seen to be feasible in the future, but not enough to support now.

This shows that now if the use of HTML5 technology, solve the following problems:

One is a locally stored version problem, so that when the server is updated, the new data is fetched from the server, and the local cache is read if there is no update.

The second is the local storage of read write, as well as the path problem, which requires a mechanism, so that the application does not need to control the source of data is local or server, the resource routing to a unified mechanism, by it to judge

Version problems have a more ready-made solution, such as time expired, or version number, add a two-dimensional code or something. Resource routing is not clear, and this requires further exploration. However, giving priority to HTML5 local storage and caching technology should be a low-cost solution to performance problems. This approach can also be prepared for future browser Peer-to-peer.

Http://www.tuicool.com/articles/eAFbu2


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.