By fenng|It can be reproduced. During reprinting, it must be indicated by a hyperlink.ArticleSource and author information and copyright notice
Web: http://www.dbanotes.net/web/best_practices_for_speeding_up_your_web_site_server.html
Web Front-end optimization best practices Part 2 is for server. Currently, there are a total of 6 practice rules. [Note: this is the most technical note. For the original content, visit: predictional performance: Best practices for speeding up your web site]
1. Use "> CDN(Use a content delivery network)
China "> the popularity of CDN is not enough. But we haveUnique problems between China Telecom and China NetcomIf you want to optimize it, you can basically get the "> CDN or similar effect (pretend to be so ). [Tin said "> CDN is used quite a lot in China. Let's look at it."> the CDN vendor's market will know that it hasn't entered the usual market]
2. Add an expires or cache-control header)
Each browser has a specific solution. For Apache example, [Note: the example below is not detailed enough, and some adjustments need to be added to the specific environment ]:
Expiresactive onexpiresbytype image/GIF "modification plus 1 weeks"
After the mod_expire module is enabled for Lighttpd:
$ HTTP ["url"] = ~ "/. (JPG | GIF | PNG) $" {expire. url = ("" => "Access 1 years ")}
Nginx example reference:
Location ~ */. (JPG | GIF | PNG) $ {If (-F $ request_filename) {expires Max; break ;}}
3. Compressed Content (gzip components)
For the vast majority of sites, this is a necessary step to effectively reduce the network traffic pressure. Some people may worry about the impact of "> CPU compression on"> CPU, so be sure to make sure it is okay. Nginx example:
Gzip on; gzip_types text/plain text/HTML text/css ext/JavaScript;
For more information, see:
How does IIS enable gzip compression?
4. Set etags (configure etags)
Etag may be ignored by most website maintainers. Before this series of optimization rules emerged, most websites on the Internet may ignore this problem. Of course, etag does not have a significant impact on the performance of most sites. Unless it is for "> RSS websites. [A friend criticized and said, "> IE does not support etag. Specifically, ie supports etag, but "> IIS should pay attention to the etag bug .]
Supplement: I mean, "many websites open etag without looking at it, but they do not know how to use it and consume resources. It does not mean that etag is not good, and the rational use of etag can definitely achieve good profits.
5. Refresh the buffer (flush the buffer early) as soon as possible)
After thinking about this article for a long time, it seems thatAsynchronous. Can it better improve user experience?
6. For "> AjaxRequest to use the get method (use get for "> AjaxRequests)
XMLHttpRequest Post takes two steps, while get takes only one step. However, you must note that on "> IE, get can process up to"> the URL length is 2 K.
Previous Article:
- Content of best web browser optimization practices
Next, analyze the cookie.