Five dead end problems that JavaScript providers should pay attention to

Source: Internet
Author: User

More and more widgets are now being used on websites, and more and more people have installed this Third-party code support to display Flickr photos, Twitter status, ITunes playlists, etc. on their website or blog. These increasing widgets, although probably only 1% are useful, and these 1% good changes to improve the overall pattern of the Internet.

But with the advent of widgets there is also a problem: using widgets can reduce the speed of your Web site. In a better case, the widgets you use comes from a stable, fast server; The bad thing is that the widgets you use comes from an unstable server, which can have a huge impact on your site.

A foreign blogger argues that there is no silver bullet in this area, and that there is no single method or technology to solve the problem. This is a multifaceted problem, and there are ways in which companies can mitigate the effects of multiple widgets, but at a certain point, the problem always happens. The following are some aspects worth considering for JavaScript providers:

1, delay the implementation of JavaScript

All JavaScript code wants to run the first time, but not really, this is a very common problem. If the script does not need to make any changes when the page is read, the script execution can be placed after the page is read. As a result, the page content can be displayed first. Unfortunately, it's not that some of the visitors do.

2, reduce the running load

Anything that runs when the page reads will slow down, so the less code is faster. Another associated with this is the search for the entire page, which can cause the entire page to read slowly. Overall, any JavaScript program running for more than 5 seconds can be problematic.

3. Load-balancing requests produce different URLs

Many modern scripts always return the same URL. With the wide application of widgets, concurrent requests through the same server will be huge. A better way is to distribute different URLs. Although different URLs can now perform the same domain name, the future will be a release to spread the browsing pressure.

4, the use of standard library

Perhaps the worst thing is to start all over again, because JavaScript is particularly prone to errors. As with Java, JavaScript sets many standard libraries, which can be more effective with standards. The original libraries are written by experienced people who understand system flaws, so it's best to use them directly.

5, more important, to think more

It is important to know that some JavaScript will run on the end user's web site, knowing that we are just part of a huge system that is being developed to reduce the likelihood of damaging other widgt and to ensure the quality of the user experience.

Related Article

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.