Web page optimization reduces the memory and CPU footprint of the page

Source: Internet
Author: User
Tags file size resource save file

Web page optimization reduces the footprint of pages on memory and CPU-web Standard tutorial

Some pages do not look small but open will be very card, and some pages, although very long but the use of fluent, the user's computer memory and CPU affect these.
Browser problems, there are different browsers to handle memory problems will affect, but almost no way to control, windows on:

· IE series, the amount of refresh recovery is small, but minimizing frees up memory.
· Firefox2 is also said to be in the minimization of recycling, but I have never seen the most rubbish, how much is how much, basically do not recycle. It is said that prototype Ajax also causes memory to increase.
· Opera is best. have been very well controlled. There is no problem.
· Linux's memory allocation mechanism is not the same as win, how much use, if the browser takes up the light might kill the system.

Page problem, browser render page consumes memory and CPU, can reduce a little bit. The

structure
uses DOCTYPE to tell the browser what you are using, and HTML4 also has a DTD. Maybe transitional is better for you.
If you are using XHTML and can maintain a good structure, remember to output the corresponding MIME and XML header 1, you can reduce the browser's code check,
to maintain the integrity of the structure, do not let the browser to help you complete the code.
Control the file size of the page, you can use the program to see the code more comfortable indentation. 2~3K is also size.
IFrame will produce a new page, in fact, there are many ways to replace the IFRAME
the introduction of JS and CSS can be properly merged, the same background picture can also be merged, and even Flash are merged to the known wide-high content picture Object plus the width of the property can reduce local rendering of the page

performance
99 and 70 jpg In most cases, only files have a different size. GIF is the same, especially small icons, 256 colors and 128 color difference is the file size.
Flash move too fast to eat the CPU is very large, control the number of frames per second and animation effect can be reduced, if the quality of the low display will save a lot of resources, but this has sacrificed the effect. Quality properties sometimes choose Autolow2 or autohigh to be more appropriate, no need to always low or best,
Flash uses vector graphics to save file size, but calculating complex graphics and animations takes the CPU. Three-link material, too many complex filters, will take up a lot of memory, blur filterhas been reduced by some 3. The
IE filters are also used to compare memory consumption while also having compatibility issues. Full-screen translucent is very eating resources. The
2*2 picture is about the same size as the 8*8 picture, but the tiled background 2*2 takes up a lot.
GIF Animation also has the concept of frames, do not take gif as a flash to play on the line.

Behavior
does not use a $ () to introduce the entire prototype or jquery, they have more effect.
Ajax is handsome. But using XML to use XML parsers, some people recommend JSON, but to eval data, you can actually import a script that is already an object. Just want to pass the object name more, or write the object name to die, or like Flickr jsonflickrapi ({"xxx": "XXX"}), directly when function, dig haha.
Don't play with Display:none when you can solve some effects with Visibility:hidden.
here to emphasize the JS variable to note the global and local and so the significance is not large, JS complex place is not one or two can be said clearly, pay attention to the monthly shadow of the publication of the book Bar.
In fact, there is a lot of content with how to quickly present our web page similar, but that is to deal with the main service, but in many cases, save the resource consumption at the same time will save the client resource consumption.
 

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.