YSLOW-23 rules

Source: Internet
Author: User

Yslowyahoo released a Firefox-based plug-in, mainly to improve the performance of the Web page design, the following is it advocated 23 rules, or very good, share:

1. Reduce the number of HTTP requestsMerge pictures, CSS, JS to improve the first access user wait time. 2. Using CDNNear cache ==> Intelligent routing ==> load balancing ==>WSA full station dynamic acceleration 3. Avoid empty src and hrefWhen the href attribute of the link tag is empty and the SRC attribute of the script tag is empty, the browser renders the URL of the current page as their attribute value, thus loading the contents of the page as their value. Test 4. Specify expires for the file headerMake content cacheable. Avoids unnecessary HTTP requests in the next page access. 5. Compress content with gzipCompressing any response of a text type, including XML and JSON, is worthwhile. Old articles 6. Put CSS to the top 7. Put JS on the bottomPrevents JS loading from blocking subsequent resources. 8. Avoid using CSS expressions 9. Place CSS and JS in an external fileThe goal is to cache, but sometimes in order to reduce the request, it will be written directly to the page, depending on the PV and IP proportional trade-offs. 10. Weigh the number of DNS lookupsReducing host names can save response time. At the same time, however, it is important to note that reducing the host reduces the number of concurrent downloads in the page. IE browser can only download two files from the same domain at the same time. When displaying multiple images on a single page, the speed at which IE users download pictures is affected. So Sina will engage n two level domain name to put the picture. 11. Streamline CSS and JS 12. Avoid jumpsSame domain: Note avoid backslashes "/" jumps; cross-domain: use alias or Mod_rewirte to create a CNAME (a DNS record that holds the relationship between domain names and domain names) 13. Delete duplicate JS and CSSRepeated invocation of the script, in addition to adding additional HTTP requests, multiple operations can also waste time. In IE and Firefox, regardless of whether the script is cacheable, there is a problem with repeating the JavaScript. 14. Configure EtagsIt is used to determine whether the elements in the browser cache are consistent with the original server. More resilient than Last-modified date, such as a file that has been modified 10 times in 1 seconds, the ETag can synthesize the inode (the number of index nodes (Inode) of the file), MTime (modification time) and size to make a precise judgment, Avoid UNIX records mtime can only be accurate to the second problem. The server cluster is used, preferably after two parameters. Reduce Web application bandwidth and load with etags 15. cacheable Ajax"Async" does not mean "instant": Ajax does not guarantee that users will not spend time waiting for asynchronous JavaScript and XML responses. 16. Use get to complete AJAX requestsWhen using XMLHttpRequest, the Post method in the browser is a "two-step Walk" process: First send the file header before sending the data. Therefore, it makes more sense to get data using get. 17. Reduce the number of DOM elementsIs there a more appropriate label that can be used? Life is more than div+css 18. Avoid 404Some sites change the 404 error response page to "Are you looking for * * * *", which improves the user experience but also wastes server resources (such as databases, etc.). The worst case scenario is a link to an external JavaScript that has a problem and returns 404 code. First, this load destroys parallel loading, and second, the browser will try to find something useful in the returned 404 response content as JavaScript code to execute. 19. Reduce the size of cookies 20. Using a domain without cookiesCompared to the chip CSS, Yahoo! 's static files are outside the primary domain, when the client requests a static file, reducing the repeated transfer of cookies to the primary domain name. 21. Do not use filters,Png24 in IE6 translucent kind of things, don't mess, calm cut into png8+jpg 22. Do not scale the picture in HTML 23. Reduce Favicon.ico and Cache

YSLOW-23 rules

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.