Yahoo gives a detailed description of the 34 rules that optimize the loading speed of the website (including the YSlow rule 22), and download the translation of the forwarded ponytail (from the Palanga image). 1. Minimize HTTP requests reduce HTTP request pictures, CSS, script, Flash, and so on these will increase the number of HTTP requests, reduce the number of these elements can reduce response time. The multiple JS, CSS in the possible case of writing into a file, the page directly written to the picture is not good practice, it should be written into the CSS, using CSS sprites to use the background to locate the small image. 2. Use a Content Delivery Network CDN is really a good thing, 8 over the server provider of this service is generally charged, I used to buy the domestic space there is this but I did not know what to use, now no ... 3. Add an Expires or a cache-The Control header sets the header file to expire or the static cache browser uses the cache to reduce the number of HTTP requests to speed up page loading, and if the page header has a long expiration time, the browser will always cache the elements in the page. However, if the contents of the page will change the name, otherwise the user will not actively refresh, to see their own measurement~This can be done by modifying the. htaccess file. 4. GZIP Components gzip Compression gzip format is a very popular compression technology, almost all browsers have the ability to decompress the gzip format, and it can compress the proportion is very large, the general compression rate of%. Compression is not compressed, you can do the next test here. 5. Put stylesheets at the top of the CSS puts the front page to allow visitors to see the full style of the site as early as possible. 6. Put Scripts at the Bottom to put JS at the bottom of the site after the completion of the function settings, of course, these JS to your loading process does not affect the content performance. 7. Avoid CSS Expressions to avoid CSS expressionscss expression is very scary, this is only supported by IE the operation of the thing is very large, you move the mouse it will be recalculated, but sometimes in order to do browser compatibility must use this||| IE6 to Die! ~8. Make JavaScript and CSS External will js and CSS outside the chain of the cache this thing, some of the more common JS and CSS, we can use the form of the chain, such as I am from Google outside the chain of jquery files, If my browser has downloaded and cached this file while browsing the other websites that use this external link file, he will not need to download it when he browses my website! ~9. Reduce DNS lookups reduced DNS lookups seem to be to reduce the site from external calls to resources, my Google Analytics and Picasa outside the chain of images are counted inside. Ten. Minify JavaScript and CSS to reduce the volume of JS and CSS JS and CSS is a skill, with the least code to achieve the same function, reduce whitespace, enhance logic, abbreviations and so on, of course, there are many tools can also help you achieve this. One. Avoid redirects avoids redirection and then writes the link, although "http://www. today-s-ooxx. com "and"http://www. Today-s-ooxx. com/"Only one Last"/"only difference, but the result is different, the server needs to take the time to redirect the former to the latter and then jump, this to own attention, you can also use alias or Mod_ in Apache Rewrite or Directoryslash solution. A. Remove Duplicate Scripts The repeated call of the Code browser does not recognize the ignore, but will be again the operation again, which is of course a big waste. -. Configure etags Configuration Etags I don't know what the hell is going on, anyway. It was removed in the htaccess. -. Make Ajax cacheable cache Ajaxajax is in real-time response, before the browser receives new data, the old data is cached, which can better improve efficiency. the. Flush the buffer Early early release buffering when a user makes a page request, the server takes 200 to 500 milliseconds to flatten the HTML, writes between the head and body, releases the buffer so that the file header is sent first, and then the file contents are sent. Improve efficiency. -. Use GET forAjax requests uses get methods to make Ajax requests get method and the server only once interaction (send data), and Post to two times (send headers and send data). -. Post-The load components delay loading component first loads the necessary components for page initialization, and then loads the other, YUI Image Loader is a good example. -. Preload components pre-loading may be used after loading, and delay loading does not conflict, it is intended to provide a faster response to subsequent requests, see the Google home page of the CSS Sprites app. +. Reduce the number of Dom Elements the complexity of the page structure means that longer download and response times, more reasonable and more efficient use of tags to structure the page, is a good front-end prerequisite. -. Split components Across Domains cross-Domain Detach component Page component multiple sources can increase your parallel download volume, but be careful not to overload more than 2-4 domain names can cause the DNS lookup waste mentioned above. +. Minimize the number of IFRAMEs reduces IFRAME count requires more efficient use of ifames. IFRAME Advantages: Facilitates download of slow ads and other third-party content, security sandbox, parallel download script iframe disadvantage: Even if empty, there will be a large resource consumption, will prevent the page onload, non-semantic A. No 404s do not appear in the 404 page site itself (non-search results) appear 404 pages, meaningless 404 pages will affect the user experience and will consume server resources. at. Reduce cookie size reduces the cookiecookie between the server and the browser through the file header Exchange, as far as possible to reduce the volume of cookies, set a reasonable expiration time, can be good to improve efficiency. -. Use Cookie-free Domains forcomponents using a non-cookie-free domain name for a component is a waste of cookie reading for a static component, a good way to store your static component using another cookie-free domain name, or you can store only a domain name with www in a cookie. -. Minimize DOM Access reduces the number of DOM accesses the DOM is very slow, try not to use JS to set the page layout. -. Develop Smart event handlers developing flexible handling handles too many elements on the DOM tree are added to the event handle, and the reaction efficiency is certainly low, and the Yui event tool has a onavailable method to help you flexibly set the DOM event handle -. Choose < link >over @import use < link >instead of @import use @import in IE and at the bottom of the page< link > As we said before to put < link >on top of. -. Avoid Filters Avoid the use of filters if alpha transparency is required, do not use alphaimageloader, it is inefficient and only applies to IE6 and the following versions, with PNG8 images. If you have to use, add _filter to avoid affecting IE7+user. in. Optimize Images optimized picture converting your GIF to PNG8 is a great way to reduce volume, and there are many ways to work with your JPG and PNG images for optimal results. -. Optimize CSS Sprites optimization css Sprites in the CSS Sprites vertical and as close as possible to arrange the picture, as far as possible to color similar pictures together, will reduce the size of the image itself and improve the speed of the page picture display. to. Don ' t scale ImagesinchHTML do not zoom in the HTML image image to use how much to use the size of the 1000x1000 picture is width= -″height= " -after ″, the number of KB itself is not reduced. +. Make Favicon. ICO Small and cacheable reduce favicon. ICO size and cache the browser of its site ICO should not often change it, it will be cached for a long time, and preferably under 1K control. -. Keep components under 25K Guarantee component under 25K iphone cannot cache more than 25K components, and this is still before being compressed. the. Pack component into a Multipart document to package components in a multipart file as if you were adding an attachment to a message, an HTTP request is enough, but this technology needs to ensure that your proxy support is not supported by the iphone.
Yahoo website Optimization 34 rule