Website Optimization improves website performance

Source: Internet
Author: User
Tags current time http request website performance

http://blog.csdn.net/jerome_s/article/details/47374191


Yahoo has 35 military rule, here are 14.1. Minimize HTTP requests. Optimized HTTP Requests
2. Using a CDN (Content distribution Network)CDN: As far as possible to avoid the internet has the potential to affect the speed and stability of data transmission bottlenecks and links, so that content transmission faster and more stable. Simple explanation: Place a good-performing link to a smooth copy server near you, use CND technology to connect it, get content at the nearest distance and fastest speed. (However, if you are using a dynamic page such as a JSP, you will still be requesting the original server.) Static resources only with CND technology-Yangzhong branch)
3. Add Expire/cache-control headerThe content of the Expire:expire header is a time value, and the value is the local expiration time of the resource, which exists locally.     In the local cache phase, a corresponding resource value is found and the current time has not exceeded the resource's expiration time, which is used directly and does not send an HTTP request. Cache-control: is one of the most commonly used headers in the HTTP protocol and is responsible for controlling the caching mechanism of the page. If the header indicates the cache, the cached content is also present locally. The operation flow is similar to expire, but there are different places, Cache-control has more options and there are more ways to handle it.
4. Enable gzip compressionIn the server to the transferred files gzip compression is sent to the browser, the browser can automatically unzip it. The advantage is that the transmitted files are smaller.
5. Place css on top of the pagePrevent low-speed pages from loading without styling or loading page content.
6. Place script at the bottom of the page (disagree)I am more in favor of the view of this article http://blog.csdn.net/jerome_s/article/details/45230603
7. Avoid using expressions in CSSCSS expressions is a CSS expression used to associate CSS attributes with JS. The use of CSS expressions words, in the page display and zoom, page scrolling, moving the mouse when you have to recalculate, specifically, the following code to move the mouse will always overlay.
8. Put JS and CSS in the external fileExtracted separately: Provides the reusability of JS and CSS, reduces page volume, provides the maintainability of JS and CSS. Write in the page: reduce the page request, improve the rendering speed of the month, this can be based on the actual choice, unload the page when: apply only to a page, infrequently accessed, scripts and styles are few.
9. Reduce DNS QueriesEvery time the DNS query almost need to 20ms,20ms when the page blank.      Browsers now generally have caches that can reduce DNS lookups. can take single-domain/multi-domain
10. Compressing JavaScript and CSS1. Remove unnecessary whitespace characters, format characters, and annotation characters. 2. Shorthand method name, parameter name, compression JS script.11. Avoid redirectsREDIRECT status: 1.         301 (Moved permanently): moved to a different location, permanently redirected.              2.302 (Found): was found, temporary redirect.     Why avoid using redirects. Reduce the number of requests, etc., as shown below
12. Remove Duplicate Scripts13. Configure the Entity label (ETAG)The ETAG entity tag, which belongs to the HTTP protocol, is supported by the Web service.     It uses a special string to represent a request resource version. The process configuration etage will help relieve the server a lot of burdens.
14. Make the AJAX cacheAjax two Request mode POST: Execute every time, not cached get: The same address is not repeated, can be cached differently
such as Peng Network1. Request Multiple server resources(a browser to a server's ask is limited, if all requests from a server will be slow.) For example, you can put static resources on the static resource server, etc.)2. Page staticFor the constant dynamic page, every request once query the database, it is bound to the server pressure. If you use static pages, you will always return static pages without querying the database, such as: news pages. Using Technology (sHTML (SSI))3. CSS SpriteMultiple icons are cut from the same picture. (Fewer server requests, loading several) the general art do, the artist really does not have the tools to do.4. Server Optimization: Detach1. Upload the file does not upload the Web server directly, but use the upload server and then upload the server in sync to the file server, request resources to request the file server directly
2. Processing of resource consumption, to special server processing, such as watermark operation
3. Database read/write separation
4. Database partition, sub-table (different tables on different hard drives, parallel operation ~)5. Using the cache 6. Search Engine Technology: Full-Text SearchHigh efficiency, fuzzy matching (Lucene)
Lucene is developed with low efficiency and with SOLR, it encapsulates lucene and improves development efficiency.

Last: Website performance analysis YSlowYSlow can analyze the site, give suggestions and rules to optimize the site. Install: Need to install Firebug in Firefox, and then install YSlow, will see in Firebug inside YSlow Introduction: 1. Different rules 2. Level View 3. Contains the specific optimization recommendations 4. Build View 5. Statistical Information View 6. The tools provided

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.