Recently saw a question on how to quickly open the site, I briefly summarize the impact website open speed 3 reasons (the question of the physical line that is unable to avoid random problems can not be solved).
The client browser is the most direct impact label rendering speed involve speed, CSS rendering speed, scripts, and dynamic function of the amount of resource consumption. The label different rendering speed different, why people like DIV + CSS layout, form rendering in the number of nested multi slow, because the table is the basis of the framework, but rendering when he needs to first total size and the size of each cell is calculated based on the contents of the table cell, and then began to render, so the speed will be slower. Like a stage curtain, we always first curtain pulled down, and then wait for after the actor came to power to adjust the position until their positions before we pull opening, so that the actor lineup once to show to the audience, but the audience face monotonous curtain waiting long time. So to minimize the use of rendering slow the label, and as far as possible the direct definition of label size, rendering computation time savings. Then there are some very important CSS or filter function expression evaluates to try to ensure that in the case of less resource consumption, the script of this principle, and save resources.
2 network at the same time the number of concurrent to reduce, and as far as possible to reduce the amount of time transmission of data. Small icon file, can be taken in the form of merger into a larger image, once direct re-completed, then the client is displayed using CSS positioning cuts part of the need to show up, thereby reducing the number of simultaneous requests. Reduce the amount of data, such as take CSS overall definition the rendering style, try not specific to each label style set, you can save a lot of code. Such as data transmission using JSON way, will save a lot of code than XML, in a page, and try not to additional references never use JS script, some large-scale repetitive regularity label rendering try using JS code to complete, more codes can be saved, and in short, the fundamental principle is to use as little as possible the amount of data to transmit as much information as possible.
3, the server is the design of the program, to avoid logic errors caused infinite loop like resources occupied, try not handle cases promptly shut down, in order to avoid unnecessary idle resources occupied wasted This is relatively simple, here is not to expand that.
没有评论:
发表评论