Yslow and page speed page performance tests

Source: Internet
Author: User
Tags gtmetrix subdomain name
How to increase the scores of yslow and page speed

In fact, it is not difficult. The following describes how to raise the level from several common aspects. Most of them come from experiences shared by friends.

Reduce page file size
    • Optimized images: compress the volume to reduce the number of scaled images.
    • Compressing CSS and JS files
Reduces the number of HTTP requests and DNS queries

The fewer HTTP requests, the better. The optimization is also very simple:

    • Merge JS and CSS files
    • Make CSS Sprite for the background image
    • Do not link too many files with other domain names.
Use cookie-free Domains

Use cookie-free DomainsThis item has a great impact on the score. We recommend that you use it.

Before the browser requests a static image from the server, it will first send the cookies under the same domain name. The server will not process these cookies. Therefore, they only consume bandwidth meaningless. Therefore, make sure that the requests for static content are non-Cookie requests.

InWp-config.phpJoin
Define ('cookie _ Domain ', 'Your blog domain name ');

In this way, all your subdomains will be cookie-free, and it is a good choice to use the subdomain name to plot the bed.
If the top-level domain name is directly used without WWW, the sub-domain name will still carry cookies after the above settings, and only another domain name can be used as a graph bed.

Add expires Headers

Expires headerIs the header packet of the expiration time. When this file expires
In fact, the header message is used to specify the cache time of a specific type of files in the browser. Some files (such as the background image andArticleImages called in.
During this period, we will not change these files. Such files can be cached for a very long time, so that the browser will not need to download these files from the server and read them directly from the cache, thus greatly accelerated
The loading speed of the website.

We only need. HtaccessNumber of Lines added to the fileCodeYou can.
# Expire images Header
Expiresactive on
Expiresdefault A0
Expiresbytype image/GIF a2592000
Expiresbytype image/PNG a2592000
Expiresbytype image/jpg a2592000
Expiresbytype image/JPEG a2592000
Expiresbytype image/ICO a2592000
Expiresbytype text/CSS a2592000
Expiresbytype text/JavaScript a2592000

Configure entity tags (etags)

In. HtaccessAdd:
Fileetag none

Other Optimizations
    • Try not to use embedded scripts and styles. They should be loaded from outside
    • Place the CSS file inSource codeTo load the JS file at the bottom of the page.
    • Optimize the CSS selector (in fact, part of the purpose of Web analysis is to improve this skill ).
    • To enable gzip, there are many implementation methods for plug-ins and code. Some host control panels can also be directly set.
    • Use cache plug-ins (hyper cache, WP super cache, etc.) and database cache plug-ins (WordPress object cache, DB cache reloaded, etc)
References

In the past, the corresponding links were put in each section of the article. Some people reported that I did not provide a solution...
Isn't it because the link style is inconspicuous. Try to put a separate section this time.

Thank you for your experience.

    • Expires headers | axiu's blog for WordPress Speed Optimization
    • HTML code layer acceleration WordPress-kangzj
    • Cookie-free domains yslow limit page Performance Optimization
    • [Website acceleration] optimized website yslow to 99 | self-built blog
Gtmetrix : Online Test of yslow and page speed

Yslow and page speed are both firebug-based plug-ins. It is convenient for friends who use Firefox to directly install extensions.

A. What Shun is used to test here isOnline webpage performance analysis tool gtmetrixThe yslow and page speed tests will also detail the scores of each project and provide suggestions for improvement.

Officially providedBookmarkletEasy to call, drag to your bookmarks or personal bar: gtmetrix test any page easily
By the way, you can drag the opera button (International Convention) to your Toolbar: gtmetrix test any page easily.

P.s.

1. In fact, it is not necessary to increase the score.
Scores are just a reference. If you are too much of a score, it will be no good. In addition, some optimizations may cause us trouble to modify theme at ordinary times.

2. This article focuses on the Performance of web pages, which is not equal to the access speed.
The access speed depends greatly on the bandwidth and performance of the host and the network environment of the visitor.

» For reprinting, please use a hyperlink to indicate the source: A. Shun blog» yslow and page Speed Optimization
» This article link: http://www.a-shun.com/archives/21431.html

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.