A brief summary of several methods to improve the loading speed of pages _ website application

Source: Internet
Author: User
A long time did not write technical aspects of things, because after a period of technology, I found more and more, learn what technology or technology should be studied to what level is really not the most important, the most important thing is to solve the problem of the method and ability. So if you write the technical articles later, you must be less technical details, a number of methods and ideas, today to give you a few ways to improve the loading time of the page, are my work in the practice of experience.

First of all, to give you a few obstacles to loadtime to improve the factors, there are insufficient welcome to add:
1, page size;
2, page connection number;
3, the server compression capability;
4, network conditions (including the bandwidth and network segments and other factors);

One, page size
The page size refers to the number of bytes in the page's content.
In the same network environment, the smaller the page natural download time faster, so within a reasonable range to reduce the page size can be optimized download speed. and the page size is mainly by the amount of HTML code to decide (of course, may include some CSS or JS code, but the main or HTML code), to reduce the size of the page, you have to according to the standards of the international standard to optimize the HTML code structure, remove some garbage meaningless code, The first 2 years of vigorous web refactoring is roughly the meaning. If you do not understand Web standards or Web refactoring, you can go to google this aspect of content, but many of the domestic learners of the understanding of Web refactoring is biased, a single view is to replace the table layout with DIV+CSS, this view does not have to ignore.

Second, page connection number
The number of page connections is the number of requests made to the server during the browser's download of the current page and its required resources from the server.
For example, a page file contains a picture, an external CSS file and an external JS file, then completely download the page required to send the server request is 4 (the current page HTML, pictures, CSS and JS each account for a number of connections), the number of connections to the page is 4.
The server processing the number of connections is a resource and time consuming, so take less than a few times more to take.
For example, you and your five buddies to buy tickets, a total of only one ticket window, is 5 people in line to buy each of the fast or a person in line to buy 5 people quickly? The answer is clear.
So reducing the number of page connections is a very necessary and very effective way.
So if you want to reduce the number of page connections? Here are some skills, such as writing a CSS need to use the background picture, can use a solution to the problem of not using two, or even the best without pictures, I personally like no picture of the green CSS code.
There is to be able to unify to a file inside as far as possible unified into a file, such as JS files and CSS files are not necessary outreach, can spit into a corresponding HTML code in the middle, so that the server sent to the browser at once, such benefits are many: first of all, reduce the number of page connections The second can be avoided due to network problems caused by the page of the Naked phenomenon (no CSS modified page is naked) and JS function function did not load finished the page function incomplete phenomenon.
See here, some friends may ask, JS and CSS code are written in a page is not very difficult to maintain it? Does the Web standard not advocate structure and performance separation, structure and behavior separation? However, web standards are indeed right. But the JS and CSS code and HTML together just to see the browser, there are many ways to do the page before the creation of CSS, JS and HTML are completely separate, and the resulting page is the synthesis of three. For example, the Apache page assembly function, or smarty in the template nesting functions.
In addition, set the browser page caching is also a good way to effectively reduce the number of page connections, improve the page load speed. Of course, this is only for those sites that are not strong in real time.

Third, the server's ability to resist pressure
The server's ability to withstand compression usually refers to the maximum number of visitors that the server can afford.
This is a hardware metric, but it can also improve the compression capability of the server by optimizing the software and the page.
The server here consists of two items, one is an HTTP server (Apache or IIS), and the other is a database server.
This is said optimization is to effectively reduce the number of server connections, improve program execution efficiency, such as static pages or use caching can reduce database pressure, reduce the number of page connections can reduce the HTTP server pressure. You can also do this by installing software or modules, such as Zend's PHP accelerator engine, and APC.

Iv. Network situation
Network status refers to the user's current network environment.
For example, dial-up users or broadband users, bandwidth is 512k or 1M, and so on, these hardware indicators like the pipeline to your computer, the larger the pipeline, the same time download the more things, the faster the natural faster.
Of course, this factor is not a Web site developers can control.

The above is I summed up a few ways to improve the page loadtime, there is no shortage of places also hope that we can add, the more the better.

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.