棣栭〉 涓存矀缃戠粶鍏徃 涓存矀seo缃戠珯浼樺寲 涓存矀缃戠珯寤鸿 鏂伴椈涓績 鑱旂郴鏂瑰紡

缃戠珯鎬ц兘鎬庝箞浼樺寲

鍙戝竷鏃堕棿锛?020-08-09 19:05
鍙戝竷鑰咃細鏅村ぉ缃戠粶
娴忚娆℃暟锛?script src="/plus/count.php?view=yes&aid=1154&mid=1" type='text/javascript' language="javascript">
涓€銆佸墠绔紭鍖?/span>
缃戠珯鎬ц兘浼樺寲鏄竴涓緢缁煎悎鐨勮瘽棰橈紝娑夊強鍒版湇鍔″櫒鐨勯厤缃拰缃戠珯鍓嶅悗绔▼搴忕瓑鍚勪釜鏂归潰锛屾垜鍙槸浠庡疄闄呯粡鍘嗗嚭鍙戯紝鍒嗕韩涓€涓嬭嚜宸辨墍灏濊瘯杩囩殑缃戠珯鎬ц兘浼樺寲鏂规硶銆備箣鎵€浠ュ湪鏍囬涓婃寕涓€涓獁eb2.0锛屾槸鍥犱负鏈枃鏇村亸閲嶄簬涓皬缃戠珯鐨勬€ц兘浼樺寲锛屾垜鎵€浣跨敤鐨勭郴缁熶篃鏄吀鍨媤eb2.0鐨凩amp鏋舵瀯銆?/span>
棣栧厛璁茶鍓嶇鐨勪紭鍖栵紝鐢ㄦ埛璁块棶缃戦〉鐨勭瓑寰呮椂闂达紝鏈?0%鏄彂鐢熷湪娴忚鍣ㄥ墠绔紝鐗瑰埆鏄〉闈㈠拰椤甸潰涓悇绉嶅厓绱狅紙鍥剧墖銆丆ss銆丣avascript銆?flash…锛夌殑涓嬭浇涔嬩笂銆傚洜姝ゅ湪寰堝鎯呭喌涓嬶紝鐩稿浜庢妸澶ч噺鐨勬椂闂磋姳鍦ㄨ壈鑻﹁€岀箒鏉傜殑绋嬪簭鏀硅繘涓婏紝鍓嶇鐨勪紭鍖栧線寰€鑳借捣鍒颁簨鍗婂姛鍊嶇殑浣滅敤銆傞泤铏庢渶杩戝皢鍐呴儴浣跨敤鐨勬€ц兘娴嬭瘯宸ュ叿yslow鍚戠涓夋柟鍏紑锛屽苟鍙戝竷浜嗚憲鍚嶇殑缃戠珯鎬ц兘浼樺寲鐨勫崄涓夋潯瑙勫垯锛屽缓璁綘涓嬭浇骞跺畨瑁厃slow锛屽苟浣滀负娴嬭瘎缃戠珯浼樺寲鏁堟灉鐨勫伐鍏枫€備笅闈㈡垜鎸戝叾涓壒鍒湁浠峰€肩殑鍏蜂綋璇存槑涓€涓嬩紭鍖栫殑鏂规硶锛?/span>
瀵逛簬绗竴娆¤闂偍缃戠珯锛屽皻鏈湪娴忚鍣╟ache涓紦瀛樻偍缃戠珯鍐呭鐨勭敤鎴凤紝鎴戜滑鍙互鍋氱殑浜嬫儏鍖呮嫭锛?/span>
1锛夊噺灏戜竴涓〉闈㈣闂墍浜х敓鐨刪ttp杩炴帴娆℃暟
瀵逛簬绗竴娆¤闂綘缃戠珯鐨勭敤鎴凤紝椤甸潰鎵€浜х敓鐨刪ttp杩炴帴娆℃暟鏄奖鍝嶆€ц兘鐨勪竴涓叧閿摱棰堛€?/span>
瀵圭瓥锛?/span>
- 灏介噺绠€娲佺殑椤甸潰璁捐锛屾渶澶х▼搴﹀噺灏戝浘鐗囩殑浣跨敤锛岄€氳繃鏀惧純涓€浜涗笉蹇呰鐨勯〉闈㈢壒鏁堟潵鍑忓皯javascript鐨勪娇鐢ㄣ€?/span>
- 浣跨敤涓€浜涗紭鍖栨妧宸э紝姣斿鍒╃敤鍥剧墖鐨勮儗鏅綅绉诲噺灏戝浘鐗囩殑涓暟锛沬mage map鎶€鏈紱浣跨敤inline images灏哻ss鍥剧墖鎹嗙粦鍒扮綉椤典腑銆?/span>
- 灏介噺鍚堝苟js鍜宑ss鏂囦欢锛屽噺灏戠嫭绔嬫枃浠朵釜鏁般€?/span>
2) 浣跨敤gzip鍘嬬缉缃戦〉鍐呭
浣跨敤gzip鏉ュ帇缂╃綉椤典腑鐨勯潤鎬佸唴瀹癸紝鑳藉鏄捐憲鍑忓皯鐢ㄦ埛璁块棶缃戦〉鏃剁殑绛夊緟鏃堕棿锛堟嵁璇村彲杈惧埌60%锛夈€備富娴佺殑web鏈嶅姟鍣ㄩ兘鏀寔鎴栨彁渚沢zip鍘嬬缉锛屽鏋滀娇鐢╝pache鏈嶅姟鍣紝鍙渶瑕佸湪閰嶇疆鏂囦欢涓紑鍚?mod_gzip锛坅pache1.x锛夋垨mod_deflate(apache2.x)鍗冲彲銆傚嚒鏄潤鎬佺殑椤甸潰锛屼娇鐢╣zip鍘嬬缉閮借兘澶熸樉钁楁彁楂樻湇鍔″櫒鏁堢巼骞跺噺灏戝甫瀹芥敮鍑猴紝娉ㄦ剰鍥剧墖鍐呭鏈韩宸茬粡鏄帇缂╂牸寮忎簡锛屽姟蹇呬笉瑕佸啀杩涜鍘嬬缉銆?/span>
3锛夊皢css鏀惧湪椤甸潰椤剁锛孞s鏂囦欢鏀惧湪椤甸潰搴曠
css鐨勫紩鐢ㄨ鏀惧湪html鐨勫ご閮╤eader涓紝js鏂囦欢寮曠敤灏介噺鏀惧湪椤甸潰搴曠鏍囩鐨勫悗闈紝涓昏鐨勬€濊矾鏄鏍稿績鐨勯〉闈㈠唴瀹瑰敖鏃╂樉绀哄嚭鏉ャ€備笉杩囪娉ㄦ剰锛屼竴浜涘ぇ閲忎娇鐢╦s鐨勯〉闈紝鍙兘鏈変竴浜沯s鏂囦欢鏀惧湪搴曠浼氬紩璧蜂竴浜涢毦浠ラ鏂欑殑闂锛屾牴鎹疄闄呮儏鍐甸€傚綋杩愮敤鍗冲彲銆?/span>
4锛変娇js鏂囦欢鍐呭鏈€灏忓寲
鍏蜂綋鏉ヨ灏辨槸浣跨敤涓€浜沯avascript鍘嬬缉宸ュ叿瀵筳s鑴氭湰杩涜鍘嬬缉锛屽幓闄ゅ叾涓殑绌虹櫧瀛楃銆佹敞閲婏紝鏈€灏忓寲鍙橀噺鍚嶇瓑銆傚湪浣跨敤gzip鍘嬬缉鐨勫熀纭€涓婏紝瀵筳s鍐呭鐨勫帇缂╄兘澶熷皢鎬ц兘鍐嶆彁楂?%銆?/span>
5锛夊敖閲忓噺灏戝閮ㄨ剼鏈殑浣跨敤锛屽噺灏慏ns鏌ヨ鏃堕棿
涓嶈鍦ㄧ綉椤典腑寮曠敤澶鐨勫閮ㄨ剼鏈紝棣栧厛锛屼竴娆ns鐨勮в鏋愯繃绋嬩細娑堣€?0-120姣鐨勬椂闂达紱鍏舵锛屽鏋滃湪椤甸潰涓紩鐢ㄥお澶氱殑澶栭儴鏂囦欢锛堝鍚勭骞垮憡銆佽仈鐩熺瓑浠g爜锛夛紝鍙兘浼氬洜涓哄閮ㄦ枃浠剁殑鍝嶅簲閫熷害鑰屽皢浣犵殑缃戠珯鎷栧緱寰堟參銆傚鏋滀笉寰椾笉鐢紝閭d箞灏卞敖閲忓皢杩欎簺鑴氭湰鏀惧湪椤佃剼鍚с€備笉杩囨湁涓€鐐归渶瑕佹彁鍙婏紝灏辨槸娴忚鍣ㄤ竴鑸彧鑳藉苟琛屽鐞嗗悓涓€鍩熷悕涓嬬殑涓や釜璇锋眰锛岃€屽浜庝笉鍚屽瓙鐨勫煙鍚嶅垯涓嶅彈姝ら檺鍒讹紝鍥犳閫傚綋灏嗘湰绔欓潤鎬佸唴瀹癸紙css,js锛夋斁鍦ㄥ叾浠栫殑瀛愬煙鍚嶄笅锛堝 static.xxx.com锛変細鏈夊埄浜庢彁楂樻祻瑙堝櫒骞惰涓嬭浇缃戦〉鍐呭鐨勮兘鍔涖€?/span>
瀵逛簬鎮ㄧ綉绔欑殑缁忓父鎬ц闂敤鎴凤紝涓昏鐨勪紭鍖栨€濊矾灏辨槸鏈€澶ч檺搴﹀埄鐢ㄧ敤鎴锋祻瑙堝櫒鐨刢ache鏉ュ噺灏戞湇鍔″櫒鐨勫紑閿€銆?/span>
1锛夊湪header涓坊鍔犺繃鏈熸椂闂?expires header)
鍦╤eader涓粰闈欐€佸唴瀹规坊鍔犱竴涓緝闀跨殑杩囨湡鏃堕棿锛岃繖鏍峰彲浠ヤ娇鐢ㄦ埛浠婂悗璁块棶鍙鍙栫紦瀛樹腑鐨勬枃浠讹紝鑰屼笉浼氫笌鏈嶅姟鍣ㄤ骇鐢熶换浣曠殑浜や簰銆備笉杩囪繖鏍峰仛涔熷瓨鍦ㄤ竴浜涢棶棰橈紝褰撳浘鐗囥€丆ss鍜宩s鏂囦欢鏇存柊鏃讹紝鐢ㄦ埛濡傛灉涓嶅埛鏂版祻瑙堝櫒锛屽氨鏃犳硶鑾峰緱姝ゆ洿鏂般€傝繖鏍凤紝鎴戜滑鍦ㄥ鍥剧墖銆乧ss鍜宩s鏂囦欢淇敼鏃讹紝蹇呴』瑕佽繘琛岄噸鍛藉悕锛屾墠鑳戒繚璇佺敤鎴疯闂埌鏈€鏂扮殑鍐呭銆傝繖鍙兘浼氱粰寮€鍙戦€犳垚涓嶅皬鐨勯夯鐑︼紝鍥犱负杩欎簺鏂囦欢鍙兘琚珯鐐逛腑鐨勮澶氭枃浠舵墍寮曠敤銆俧lickr鎻愬嚭鐨勮в鍐冲姙娉曟槸閫氳繃url rewrite浣夸笉鍚岀増鏈彿鐨刄rl浜嬪疄涓婃寚鍚戝悓涓€涓枃浠讹紝杩欐槸涓€涓仾鏄庣殑鍔炴硶锛屽洜涓簎rl绾у埆鐨勬搷浣滄晥鐜囨槸寰堥珮鐨勶紝鍙互缁欏紑鍙戣繃绋嬫彁渚涗笉灏戜究鍒┿€?/span>
瑕佺悊瑙d负浠€涔堣繖鏍峰仛锛屽繀椤昏浜嗚в娴忚鍣ㄨ闂畊rl鏃剁殑宸ヤ綔鏈哄埗锛?/span>
a. 绗竴娆¤闂畊rl鏃讹紝鐢ㄦ埛浠庢湇鍔″櫒娈佃幏鍙栭〉闈㈠唴瀹癸紝骞舵妸鐩稿叧鐨勬枃浠讹紙images,css,js…锛夋斁鍦ㄩ珮閫熺紦瀛樹腑锛屼篃浼氭妸鏂囦欢澶翠腑鐨別xpired time,last modified, etags绛夌浉鍏充俊鎭篃涓€鍚屼繚鐣欎笅鏉ャ€?/span>
b. 鐢ㄦ埛閲嶅璁块棶url鏃讹紝娴忚鍣ㄩ鍏堢湅楂橀€熺紦瀛樹腑鏄惁鏈夋湰绔欏悓鍚嶇殑鏂囦欢锛屽鏋滄湁锛屽垯妫€鏌ユ枃浠剁殑杩囨湡鏃堕棿锛涘鏋滃皻鏈繃鏈燂紝鍒欑洿鎺ヤ粠缂撳瓨涓鍙栨枃浠讹紝涓嶅啀璁块棶鏈嶅姟鍣ㄣ€?/span>
c. 濡傛灉缂撳瓨涓枃浠剁殑杩囨湡鏃堕棿涓嶅瓨鍦ㄦ垨宸茶秴鍑猴紝鍒欐祻瑙堝櫒浼氳闂湇鍔″櫒鑾峰彇鏂囦欢鐨勫ご淇℃伅锛屾鏌ast modifed鍜孍tags绛変俊鎭紝濡傛灉鍙戠幇鏈湴缂撳瓨涓殑鏂囦欢鍦ㄤ笂娆¤闂悗娌¤淇敼锛屽垯浣跨敤鏈湴缂撳瓨涓殑鏂囦欢锛涘鏋滀慨鏀硅繃锛屽垯浠庢湇鍔″櫒涓婅幏鍙栨渶鏂扮増鏈€?/span>
鎴戠殑缁忛獙锛屽鏋滃彲鑳斤紝灏介噺閬靛惊姝ゅ師鍒欑粰闈欐€佹枃浠舵坊鍔犺繃鏈熸椂闂达紝杩欐牱鍙互澶у箙搴﹀噺灏戠敤鎴峰鏈嶅姟鍣ㄨ祫婧愮殑閲嶅璁块棶銆?/span>
2锛夊皢css鍜宩s鏂囦欢鏀惧湪鐙珛澶栭儴鏂囦欢涓紩鐢?/span>
灏哻ss鍜宩s鏂囦欢鏀惧湪鐙珛鏂囦欢涓紝杩欐牱瀹冧滑浼氳鍗曠嫭缂撳瓨璧锋潵锛屽湪璁块棶鍏朵粬椤甸潰鏃跺彲浠ヤ粠娴忚鍣ㄧ殑楂橀€熺紦瀛樹腑鐩存帴璇诲彇銆備竴浜涚綉绔欑殑棣栭〉鍙兘鏄緥澶栫殑锛岃繖浜涢椤电殑鑷韩娴忚鍙兘骞朵笉澶э紝浣嗗嵈鏄敤鎴疯闂綉绔欑殑绗竴鍗拌薄浠ュ強瀵煎悜鍒板叾浠栭〉闈㈢殑璧风偣锛屼篃鍙兘杩欎簺椤甸潰鏈韩浣跨敤浜嗗ぇ閲忕殑ajax灞€閮ㄥ埛鏂板強鎶€鏈紝杩欐椂鍙互灏?css鍜宩s鏂囦欢鐩存帴鍐欏湪椤甸潰涓€?/span>
3锛夊幓鎺夐噸澶嶇殑鑴氭湰
鍦↖e涓紝鍖呭惈閲嶅鐨刯s鑴氭湰浼氬鑷存祻瑙堝櫒鐨勭紦瀛樹笉琚娇鐢紝浠旂粏妫€鏌ヤ竴涓嬩綘鐨勭▼搴忥紝鍘绘帀閲嶅寮曠敤鐨勮剼鏈簲璇ヤ笉鏄竴浠跺緢闅剧殑浜嬫儏銆?/span>
4锛夐伩鍏嶉噸瀹氬悜鐨勫彂鐢?/span>
闄や簡鍦╤eader涓汉涓虹殑閲嶅畾鍚戜箣澶栵紝缃戦〉閲嶅畾鍚戝父鍦ㄤ笉缁忔剰闂村彂鐢燂紝琚噸瀹氬悜鐨勫唴瀹瑰皢涓嶄細浣跨敤娴忚鍣ㄧ殑缂撳瓨銆傛瘮濡傜敤鎴峰湪璁块棶锛屾湇鍔″櫒浼氶€氳繃301杞悜鍒?锛屽湪鍚庨潰鍔犱簡涓€涓?ldquo;/”銆傚鏋滄湇鍔″櫒鐨勯厤缃笉濂斤紝杩欎篃浼氱粰鏈嶅姟鍣ㄥ甫鏉ラ澶栫殑璐熸媴銆傞€氳繃閰嶇疆apache鐨?alias鎴栦娇鐢╩od_rewrite妯″潡绛夋柟娉曪紝鍙互閬垮厤涓嶅繀瑕佺殑閲嶅畾鍚戙€?/span>