Talking with data: a general solution to slow Web Access

Source: Internet
Author: User
Keywords Too slow

Intermediary transaction SEO diagnosis Taobao guest Cloud host technology Hall

Site access speed problem should be in the webmaster should consider the highest priority, the site is slow to visit the site is directly related to the number of visitors, user experience degree of problem. Today I'm going to introduce you to a few common ways to solve Web sites too slowly.

1. Through the browser plug-in to find the Web page in the process of loading time problem

It is recommended to use Firefox's firefbug or Google browser developer tools (F12), Firebug for example, after installing Firebug, in the case of open Firebug, refresh your site page, as shown:

  

With the Network tab in the Firebug plug-in, I can know the Web page in the loading process, all the requests of the speed of access, such as the above, through the details of the specific request to see, I know this domain name light parsing unexpectedly used 2 seconds, and wait for response unexpectedly out for nearly 2 minutes. And then there's a lot of time to receive data. You can then use Firebug to find out which request link takes the longest.

2. Through the browser plug-in, to find the server optimization is not enough

We will start a slower request, looking at the detailed header:

url:http://lszm.zmke.com/wp-includes/css/admin-bar.css?ver=20111209

Cache-control max-age=0

Through header information, found that the CSS file as a static resource, its Cache-control the maximum amount of memory is 0, that is, it prohibits caching, so for each user's access, each may need to request from my server to the resources, the display server pressure is also large, user access is also slow , and I went to see Baidu's response header information

Url:http://www.baidu.com/img/baidu_sylogo1.gif
Cache-control max-age=315360000
Expires Thu, Dec 2021 06:53:18 GMT
Accept-encoding gzip, deflate

Hundred of the pictures in the browser cache expiration date is 10, to 2021, and the page is also after Gzip compressed, the maximum cache size is also very large.

And Baidu's access process is also illustrated by this, through such optimization, the load from the server is no longer the amount of data, total 86KB, of which 33KB from the browser cache

  

3. Problem solving

The conclusion from the above method is that for this site, the main problem to be solved is:

A. Analytical issues

B. Server optimization

C. Network issues

Parsing problems in fact very good to do, there are many free DNS providers, if we have such a problem, directly change the DNS provider on the line. This is mainly to say the setting of cache time, take the Nginx server as an example.

Open the Nginx profile,

Location/{
root/var/www;
Index index.html index.htm index.php;
}
Location ~* ^.+\. (Jpg|jpeg|swf|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov) {
root/var/www;
Access_log off;
Expires 350d;
}

In location, we can do a special caching of static files, add expires, that is, the expiration time, where I set the 350 days, that is, if the user did not empty their browser cache, then after the visit once, after two visits, will be directly from the browser cache to get pictures, and no longer through my server, so obviously, for pictures, static resources, a lot of sites, so the effect of increasing speed is obvious.

HTTP {
Include/etc/nginx/mime.types;
15
Access_log/dev/null;
17
Sendfile on;
Tcp_nopush on;
20
#keepalive_timeout 0;
Keepalive_timeout 0;
Tcp_nodelay on;
Client_max_body_size 160m;
-Gzip on;
Gzip_disable "MSIE [1-6]\. (?!. *SV1) ";

In the HTTP zone, we set gzip to on, and in the end I did some regular parameters, that is, ie1-6 is not compressed because ie1-6 is not very good for compression support.

After doing these two, and then restarting the NIGNX server, it will begin to take effect.

Of course some of the students ' website may not be able to contact the server this layer, such as virtual host users, here, I introduce you to use the Accelerated Le (www.jiasule.com) Free CDN Service, after joining, the CDN node will be the above problems properly resolved, including domain name analysis, Telecom Netcom's interoperability issues. Look at the effect:

  

Finally: Of course, acceleration is not omnipotent, choose a good server is the most fundamental, if the above method can not solve the problem, it must be considered from the hardware upgrade.

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.