һ
 ע

QQ¼

ֻһٿʼ

ƼĶ

+
̳ WEBҳǰ뿪 WEBҳܱ

[ҳ] ŻվҳŻ34ƽ

[]
11063 happy175 2014-8-5 10:16:09
| ʾȫ¥
1F

ϵ½עᣬύѣø๦ܣϴزIJޣ

Ҫ ¼ ſػ鿴ûʺţע  

x
ŻŶӾ飺վҳŻ34ƽ
1HTTP
     նûӦʱУ80%ظݡⲿʱҳеͼʽűFlashȡͨҳеԪؿԼHTTPĴҳٶȵĹؼ衣
     ҳķʵǼҳôûһַܱҳݵķḻܴﵽӿӦʱĿأмHTTPͬʱֿܱҳݷḻļ

ϲļͨеĽűŵһļHTTPķԼ򵥵ذеCSSļһʽСűʽڲͬҳʹʱҪͬ޸ģܻ鷳㣬ҲҪΪҳܵҪһ

CSS SpritesǼͼЧеıͼ񶼷ŵһͼƬļУȻͨCSSbackground-imagebackground-positionʾͼƬIJ֣ͬ

ͼƬͼǰѶͼƬϵһͼƬСȻļСı䣬ǿԼHTTPͼƬͼֻͼƬɲҳǽһʱʹã絼ȷͼƬͿܻȽϷ׳ͬʱʹͼƬͼҲпɶԣ˲Ƽַ

ͼʹdata:URL schemeķͼݼҳСܻҳĴСͼŵʽɻ棩пԼHTTPͬʱֱҳļĴСͼڻûеõ֧֡

    ҳHTTPҪһǸĽ״ηûȴʱҪķͬTenni TheurerIJBrowser Cahe Usage - Exposed!˵HTTP޻ռȥ40%60%Ӧʱ䡣Щηվ˻øӿٵɣ

2DNSҴ
       ϵͳDNSṩIPĶӦϵ绰ǵĵ绰Ĺϵһַwww.dudo.orgʱDNSͻ᷵ӦIPַDNSĹͬҲҪʱġһ·ظӦIPַỨ20120ʱ䡣ʲôֱDNSϡ

      DNSҿԸҳܡֻҪһضĻַһûISPṩ̻߱ؾƣͬûʹõļϲ档DNSϢᱣڲϵͳDNSУ΢WindowsϵͳDNS Client ServiceжڲϵͳԼĻ档ԼĻ¼һܵϵͳӰ졣

     Internet ExplorerĬ¶DNSҼ¼ĻʱΪ30ӣעеļֵΪDnsCacheTimeoutFirefoxDNSIJҼ¼ʱΪ1ӣļеѡΪnetwork.dnsCacheExpirationFasterfoxѡΪ1Сʱ

     ͻеDNS涼ΪʱͲϵͳΪգDNSҵĴҳͬаҳURLͼƬűļʽFlashȰԼDNSҴ

     ԼҳвصDNSҴԽʡӦʱ䣬ǼٲȴӦʱ䡣ҵָԭǰЩҳеݷֵָIJֽ֡ڼDNSҴͱֽϸ̶߳Ȳ֮Ȩˡ


תʹ301302ʵֵġһӦΪ301HTTPͷ
     HTTP/1.1 301 Moved Permanently
     Location: http://example.com/newuri
     Content-Type: text/html
     ûָLocationָURLͷļеϢһתжDZģݲֿΪաǵƣ301302ӦᱻһͷѡExpiresCache-Controlָ档<meat />Ԫصˢ±ǩJavaScriptҲʵURLתҪתʱõķʹñ׼3XXHTTP״̬룬ҪΪȷˡťȷʹá

     Ҫסתήû顣ûHTMLĵмһתҳԪصʾΪHTMLļǰκļͼFlashȣᱻء

     һ־ҳߺȴʮ˷ӦʱתڵURLбܣ/ȴԵʱ磬Ҫhttp://astrology.yahoo.com/astrology ʱʵϷصһ301תָhttp://astrology.yahoo.com/astrology/  עĩβбܣApacheпʹAlias mod_rewritethe DirectorySlash⡣

     վ;վתܾõһҪվIJͬȻûIJͬͣ͡û˺ͣתʹתʵվлʮּ򵥣ҪĴҲࡣʹַڿ˵Խ͸ӳ̶ȣͬû顣һͬһ̨ʱʹAliasmod_rewriteʵ֡ΪIJͬתôͨʹAliasmod_rewirteCNAMEһһ֮ϵDNS¼

4ɻAJAX
     AjaxἰһôӺ̨Ϣ첽ԶΪûķļʱԡǣʹAjaxܱ֤ûڵȴ첽JavaScriptXMLӦϻʱ䡣ںܶӦУûǷҪȴӦȡAjaxʹá磬һWebEmailͻУûȴAjaxطʼѯסһ㣬첽ζšʱҪ

     ΪܣŻAjaxӦǺҪġAjxaܵĴʩҪķʹӦпɻԣۿԲ鿴Add an Expires or a Cache-Control HeaderļҲͬAjax
   Gizpѹļ
   DNSҴ
   JavaScript
   ת
   ETags

    һӣһWeb2.0Emailͻ˻ʹAjaxԶɶûַءûϴʹùEmail webӦóûжԵַκε޸ģAjaxӦͨExpireCacke-Controlͷʵֻ棬ôͿֱӴһεĻжȡַˡ֪ʹûеĵַǷһµͨΪȡַAjax URLһϴα༭ʱʱʵ֣磬&t=11900241612ȡַϴغûб༭ʱͲ䣬ĻмشӶһHTTP̡û޸ĹַʱͻȷµURLͻӦƥ䣬ͻҪµַ
       ʹAjxaӦǶ̬ɵģֻһûôҲӦñʹWeb2.0Ӧóӿݡ

5Ƴټ
       ϸһҳԼЩҳʱȼصģЩݺͽṹԺټأ
       ̰onload¼ָ֣JavaScriptһѡ磬ʵϷźͶJavaScriptôԵȴԺأΪҳϵϷԪڳʼ֮ŷġزֵݣûֵ֮ݣʹ۵ֵͼҲƳټ
       ߿ԽʡĹYUI Image Loader԰Ƴټ۵ֵͼƬYUI Get utilityǰJS CSSıݷԴFirebugNetѡһYahooҳ
       Ŀվʵһʱͻá£ͨվܵķǣ֧JavaScript£ȥû飬Ҫ֤վûJavaScriptҲСȷҳټؽűʵϷźͶȸӻڵЧ


       Ԥغͺؿƺǡǡ෴ʵԤΪʵһĿꡣԤʱܻõҳݣͼʽͽűʹַûҪһҳʱҳеݴ󲿷Ѿصˣ˿ԴƷٶȡ

ṩ˼Ԥط
أonload¼ʱֱӼضҳݡGoogle.comΪԿһspirit imageͼonloadмصġspirit imageͼgoogle.comҳDzҪģȴҳõ
أûIJиݵжûȥҳ沢ӦԤҳݡsearch.yahoo.comԿʱضҳݡ
ԤڵļأƹҳʱʹԤءҳ澭ƺûԹµҳ濴ܿᣬȴǰܳûľվ㽨Ļ棬վȴûκλݡڷվ֮ǰͼһֽij֡ľվĿʱվõͼĺͽű߷ٶȡ

7DOMԪ
       һӵҳζҪظݣͬʱҲζJavaScriptDOMЧԽ統һ¼ʱ5005000DOMԪѭЧ϶Dzһġ
      DOMԪصĴζҳпԲƳֻҪ滻ԪرǩͿԾIJ֡ҳ沼ʹñûнΪ˲ֶ<div>ԪأҲһʺϻǸеıǩԹʹá
       YUI CSS utilitiesԸIJִ޴grids.css԰ʵ岼֣font.cssreset.css԰ƳĬϸʽṩһҳбǩĻᣬֻʱʹ<div>ΪлЧʹ
     DOMԪ׼ֻҪFirebugĿ̨룺
document.getElementsByTagName('*').length
       ôٸDOMԪǶأԶкܺñʹõҳ档Yahoo!ҳһݷdzҳ棬ֻʹ700ԪأHTMLǩ


     ҳݻֳɲֿʹ޶ȵʵƽءDNSҴӰҪȷʹõ24֮䡣磬԰õHTMLݺͶ̬ݷwww.example.orgϣҳͼƬűCSS)ֱstatics1.example.orgstatics.example.orgϡ
Tenni TheurerPatty ChiдMaximizing Parallel Downloads in the Carpool LaneҵϢ

9ʹiframeС
     ifrmaeԪؿڸĵвһµHTMLĵ˽iframeĹȻܸЧʹһҪ

<iframe>ŵ㣺
ػĵͼ͹ȵļ
Security sandbox
мؽű
<iframe>ȱ㣺

ʱΪգҲҪʱ
ֹҳ
û
10Ҫ404
     HTTPʱǺܴģʹHTTPһûôӦ404ûҵҳ棩ȫûбҪģֻήûһô
     Щվ404ӦҳΪDzҪ***ȻĽû鵫ͬҲ˷ѷԴݿȣָⲿJavaScriptӳⲢ404롣ȣּػƻмأͼڷص404ӦҵõIJֵJavaScriptִС

11ʹݷַ
     ûվĽӽ̶ȻӰӦʱij̡վݷɢڲͬλõķϿԼӿٶȡӦЩʲôأ
     վݵĵһҪ¼ܹվڷַСӦõıվṹܻһЩȽϸӵڷͬSession״̬ͺϲݿµȡҪûݷľ룬ЩܹDzɱġ
     ҪסնûӦʱ80%90%ӦʱͼʽűFlashҳݡվܻƽ򡣺ӦóܹȽѵȣֲ̬ݻһ㡣ⲻӦʱ䣬Ҷݷַ˵ʵ֡
     ݷַ磨Content Delivery NetworkCDNһϵзɢͬλϵWebɵģվݵĴٶȡûݵķҪǸݺûϵĿ̶ָġ磬ӵnetwork hoPSӦٶķᱻѡ
     һЩ͵繫˾ӵԼCDNʹAkamai TechnologiesMirror Image Internet Limelight NetworksCDNɱȴdzߡڸո𲽵ҵ͸վ˵ûʹCDNijɱԤ㣬ĿûȺIJ͸ȫ򻯣CDNʵֿӦˡYahoo˵תƵCDNϵվ̬ݽʡնû20%ϵӦʱ䡣ʹCDNһֻҪԼ򵥵޸Ĵʵվٶȵķ

12ΪļͷָExpiresCache-Control
     ݣ
ھ̬ݣļͷʱExpiresֵΪNever expireڣ
ڶ̬ݣʹǡCache-Controlļͷ
     ҳԽԽḻζҳҪĽűʽͼƬFlashһηҳûζŽжεHTTP󣬵ͨʹExpiresļͷͿʹݾлԡ˽ҳвҪHTTPExpiresļͷͼļӦеݶʹűʽFlashȡ
     ʹʹûHTTPĴСʹԼӿҳٶȡWebHTTPӦʹExpiresļͷ߿ͻҪ೤ʱ䡣һϳʱExpiresļͷӦֱ2010415ղŹڡ
     Expires: Thu, 15 Apr 2010 20:00:00 GMT
     ʹõApacheʹExpiresDefault趨ԵǰڵĹʱ䡣ʹExpiresDefault趨ʱ10ڵļͷ
     ExpiresDefault "access plus 10 years"
     ҪмǣʹExpiresļͷҳݸıʱͱıݵļYahoo!˵ǾʹIJ裺ݵļмϰ汾ţyahoo_2.0.6.js
     ʹExpiresļͷֻлûѾʹվŻáû״ηվʱԼHTTP˵ЧģΪĻǿյġַվܵĸĽҪǡԤ桱ʱҳĵƵʣԤ桱ѾҳеݣYahoo!һײǷеҳ75~85%СԤ桱ͨʹExpiresļͷ˻ݵҿûٴʹЩݣҪͨûһֽڵ

13Gzipѹļ
     紫еHTTPӦʱͨǰ˻ƵõơȷնûĴṩߡԵȽĿ̶ȵȶվܾġǻӰӦʱ䡣ͨСHTTPӦĴСԽʡHTTPӦʱ䡣
     HTTP/1.1ʼwebͻ˶Ĭ֧HTTPAccept-Encodingļͷѹʽ   
     Accept-Encoding: gzip, deflate
     webļͷм⵽Ĵ룬ͻԿͻгķʽѹӦݡWebѹʽͨӦļͷеContent-Encodingظ
     Content-Encoding: gzip
     GzipĿǰҲЧѹʽGNUĿͨRFC 1952׼ġеһѹʽdeflateʹ÷ΧЧҲѷɫ
     GzipſԼ70%ӦģĿǰԼ90%ͨĻ֧gzipʽʹõApachegzipģúİ汾йأApache 1.3ʹmod_zipApache 2.xʹmoflate
     ʹ⣺յĺʵʽյݻڲƥҺãžʽʹļڼ١ApacheģͨԶʵVaryӦļͷ״ij֡
     ļѡҪgzipѹļ˿ѹļwebѹHTMLĵԽűʽѹͬҲֵ飬Ǻܶwebûܡʵϣѹκһı͵ӦXMLJSONֵõġͼPDFļѾѹԲٽgzipѹͼgizpѹЩļĻ˷CPUԴļĴС
     GzipѹпܵļǼļûļ򵥷

14ETag
     Entity tagsETagsʵǩwebжеݺͷеԭʼǷƥһֻƣʵ塱˵ġݡͼƬűʽȣETagΪʵ֤ṩһʹálast-modified dateϴα༭ʱ䣩ĻơEtagһʶݰ汾ŵΨһַΨһĸʽƾ˫ڡԭʼͨETagļͷӦָҳݵETag
     HTTP/1.1 200 OK
     Last-Modified: Tue, 12 Dec 2006 03:03:59 GMT
     ETag: "10c24bc-4ab-457e1c1f"
     Content-Length: 12195
     ԺҪ֤һļʹIf-None-MatchļͷETagظԭʼУETagƥ䣬ͻ᷵һ304״̬룬ͽʡ12195ֽڵӦ      GET /i/yahoo.gif HTTP/1.1
     Host: us.yimg.com
     If-Modified-Since: Tue, 12 Dec 2006 03:03:59 GMT
     If-None-Match: "10c24bc-4ab-457e1c1f"
     HTTP/1.1 304 Not Modified
     ETagڣǸݿԱվڵķľΨһԵɵġһ̨ϻҳݺһ̨Ͻ֤ʱETagͻ᲻ƥ䣬ʹ÷ʹվ˵ǷdzġĬ£ApacheIISǶETagУٶļ֤ͻ
     Apache 1.32.xеETagʽΪinode-size-timestampʹijļڲͬķϻᴦͬĿ¼£ļСȨޡʱȶȫͬڲͬǵҲDzͬġ
     IIS 5.0IIS 6.0ETagĻơIISеETagʽΪFiletimestamp:ChangeNumberChangeNumberIISõĸı䡣վõIJͬIISChangeNumberҲͬ ͬķϵApacheIISʹȫͬݲETagҲͬûյһС304Ӧ෴ǻһ200Ӧȫݡվֻһ̨ϣͲ⡣վǼڶϣʹApacheIISĬϵETagãûҳͻһ㣬ᴫݣռøĴҲЧػվݡʹӵExpiresļͷûʲôʱˢ¡ߡءťᷢӦGET
     ûʹETagṩ֤ģʽôɴеETagȥáLast-Modifiedļͷ֤ǻݵʱġȥETagļͷӦ´ļĴС΢ƪ֧ĸ彲ȥETagApacheУֻҪļмһдͿˣ
     FileETag none

15ˢ
     ûһҳʱζỨ200500ں̨֯HTMLļڼ䣬һֱеȴݷءPHPУʹflush()ѾĺõIJHTMLӦļȷ͸ʱͻļеݣűȣ̨ͬʱʣHTMLҳ档Чں̨ջǰ̨Ͽʱԡ
     Ӧõһطǽ<head />֮ΪHTMLͷɶͷCSSJavaScriptļͿں̨ʣHTMLͬʱǡ ӣ

     ... <!-- css, js -->
   </head>
   <?php flush(); ?>
   <body>
     ... <!-- content -->

Ϊ֤ʹĺôYahoo!оûԡ

16ʹGETAJAX
     Yahoo!MailŶӷ֣ʹXMLHttpRequestʱеPOSTһߡḶ́ȷļͷȻŷݡʹGETΪǡΪֻ跢һTCPкܶcookieIEURL󳤶Ϊ2KҪһ2KʱͲʹGETˡ
     һȤIJͬPOSTGETʵʷݡHTTP淶GETζšȡݣ˵ȡʱʹGET壨ϽҲˣ෴Ͳڷ˱ʱʹPOST

17ʽڶ
     оYahoo!ܱʱǷְʽŵĵ<head />ڲƺӿҳٶȡΪʽŵ<head />ڻʹҳвļʾ
     עܵǰ˷ϣҳؼءͬʱҲϣѾյݾʾӵн϶ݵҳٽû˵رҪûؿӻķָ룬Ѿ˽ϺõоγʽĵǵоHTMLҳǽָ롣ؼļͷlogoȶڵȴҳصû˵Ϊӻķϸû顣
     ʽĵײڰInternet Explorerڵĺֹܶݵֹ֡Ϊ˱ʽıҳԪػ档ûòһհҳ档
     HTML淶ָʽҪŰҳ<head />ڣ<a />ͬ<link />ֻܳĵ<head />ڣԶʹdzûʽݶֵȥԡõķǰHTML淶ĵ<head />ڼʽ

18ʹCSSʽExpression
     CSSʽǶ̬CSSԵǿ󣨵ΣգInternet Explorerӵ5汾ʼ֧CSSʽУʹCSSʽʵָһСʱлһαɫ
     background-color: expression( (new Date()).getHours()%2 ? "#B8D4FF" : "#F08A00" );
ʾexpressionʹJavaScriptʽCSSԸJavaScriptʽļáexpressionвãڿеInternet ExplorerʱȽá
     ʽļƵҪĶࡣҳʾʱҳƶʱҪ¼һΡCSSʽһԸٱʽļƵʡҳƶ궼ɴﵽ10000ϵļ
     һCSSʽķʹһԵıʽڵһʱָʽԣCSSʽʽԱҳڶ̬ظı䣬ʹ¼CSSʽһа취ʹCSSʽһҪסҪǧβҿܻҳܲӰ졣

19ʹⲿJavaScriptCSS
     ܹܶǹδⲿļġǣȡЩʩǰܻʵһ⣺JavaScriptCSSӦ÷ⲿļػǰǷҳ汾֮أ
     ʵӦʹⲿļҳٶȣΪJavaScriptCSSļв档HTMLĵеJavaScriptCSSÿHTMLĵءȻHTTPĴȴHTMLĵĴСһ˵ⲿļеJavaScriptCSS棬ûHTTPͬʱԼHTMLĵĴС
     ؼǣⲿJavaScriptCSSļƵʺHTMLĵĴйءȻһѶȣȻһЩָһһỰûվеĶҳ棬ЩҳлظʹͬĽűʽⲿļͻ洦
     վûйܽЩָꡣЩվ˵õļǰJavaScriptCSSΪⲿļáȽʺʹôվҳYahoo!ҳMy Yahoo!ҳһλỰӵн٣ֻһΣԷJavaScriptCSSնû˵ӿӦʱ 䡣
     ӵнϴҳ˵һּƽôHTTPͨʹⲿļлĺôһҳJavaScriptCSSҳɺ̬ⲿļҳʹõЩļʱѾ浽ˡ

20JavaScriptCSS
     ָȥ벻ҪַļСӶʡʱ䡣ʱеע͡ҪĿհַո񡢻СtabȶҪȥJavaScriptУҪصļС˴ӶʡӦʱ䡣JavaScriptĿǰõ㷺JSMinYUI CompressorYUI CompressorھCSS
     һֿԴŻķַҪȾһЩڻĹ̸ײ⡣ڶǰ10վĵз֣ҲСԭ21%Դﵽ25%ܻԸõ룬ǶJavaScript˵ķոС
     ⲿĽűʽļ⣬<script><style>ҲԲӦýʹGzipѹűʽЩļȻԽʡ5%ϵĿռ䡣JavaScriptCSSĹܺӣ뽫洦

21<link>@import
     ǰʵᵽCSSӦ÷ڶس֡
     IEУҳײ@importʹ<link>һģòҪʹ

22ʹ˾
     IEAlphaImageLoader7.0°汾ʾPNGͼƬİ͸Ч˾ͼƬʱֹݵijֲҶÿһԪأͼƬһΣڴ濪֧Ƕ෽ġ
     ȫʹAlphaImageLoader÷ʹPNG8ʽ棬ָʽIEкܺõعȷʵҪʹAlphaImageLoaderʹ»_filterʹ֮IE7ϰ汾ûЧ

23ѽűҳײ
     űֹҳƽءHTTP/1.1 淶飬ÿIJݲͼƬڶϣÿͬʱ2ϵļǵؽűʱͲͬʱļˣͬ
     ijЩ°ѽűƵҳײ̫ܲס˵űʹdocument.writeҳݣͲܱƶˡܻ⡣ܶ£ⷽ⡣
     һõʹӳٽűDEFERԱűûаdocument.writeʾҵǣFirefox֧DEFERԡInternet ExplorerУűܻᱻӳٵЧҲűԱӳ٣ôͿƵҳĵײҳصĿһ㡣

24޳ظű
     ͬһҳظJavaScriptļӰҳܡܻΪǰ10վĵʾҴظýűҪصһűظõŶӹģͽűĴظű𲻱ҪHTTPõJavaScript㣬⽵վܡ
     Internet ExplorerлҪHTTP󣬶FirefoxȴᡣInternet ExplorerУһűζֲɻ棬ͻҳعвHTTP󡣼ʱűԻ棬ûҳʱҲHTTP
     ӶHTTP⣬űҲ˷ʱ䡣Internet ExplorerFirefoxвܽűǷɻ棬ǶظJavaScript⡣
     һżͬһűķģʹýűģýűHTMLҳʹ<script />ǩýűǣ
     <script type="text/javascript" src="menu_1.0.17.js"></script>
PHPпͨΪinsertScriptķ
     <?php insertScript("menu.js") ?>
Ϊ˷ֹظýűлӦʹűĿ¼ΪűļӰ汾Expireļͷȡ

25DOM
     ʹJavaScriptDOMԪرȽΪ˻øӦҳ棬Ӧ
ѾʹйԪ
¸ڵ֮ٽӵĵ
ʹJavaScript޸ҳ沼
     йش˷ĸϢ鿴Julien LecomteYUIרе¡AjaxӦó򡱡

26¼
     ʱǻоҳ淴ӦٶۣΪDOMԪи˹¼Щ¼䲡ƵشΪʲô˵ʹevent delegation¼һֺ÷ˡһdiv10ťֻҪdivϸһ¼ͿˣȥΪÿһťһ¼ðʱԲ׽¼жϳĸ¼ġ
     ͬҲΪ˲DOMȴonload¼ķҪľǵȴṹҪʵԪس֡Ҳõȴͼ񶼼ϡ
     ܻϣDOMContentLoaded¼onload֧֮ǰʹYUI ¼ӦóеonAvailable

27СCookie
     HTTP coockieȨ֤͸Իݵȶ;coockieڵйϢͨHTTPļͷweb֮нġ˱coockieܵСԼûӦʱʮҪ
йظϢԲ鿴Tenni TheurerPatty Chi¡When the Cookie CrumblesоҪ

ȥҪcoockie
ʹcoockieСԼٶûӦӰ
עӦcoockieԱʹӰ
úĹʱ䡣ExpireʱͲҪȥcoockieûӦʱ䡣

28ҳʹcoockie
     ͬʱһž̬ͼƬͷcoockieʱЩcoockieκεʹáֻΪijЩض紫䡣Ӧȷھ̬ݵcoockie󡣴һо̬ݡ
     www.example.orgstatic.example.orgϴھ̬ݡǣ㲻www.example.org϶ڶexample.orgcoockieôжstatic.example.org󶼰coockie£¹һµھ̬ݣҪcoockieġYahoo!ʹõymig.comYouTubeʹõytimg.comAmazonʹõimages-anazon.comȵȡ
     ʹcoockieھ̬ݵһôһЩܻܾcoockieл档һصĽǣȷӦʹexample.orgwww.example.orgΪһҳҪǵcoockieӰ졣Եwwwʹ˰coockieõ*.example.org*Ƿdudoעûѡ˳ܷĿʹôwwwcoockie

29Żͼ
     Աɶҳ֮󣬲ҪڽϴwebﻹҪ£

ԼһGIFͼƬͼɫǷ͵ɫһ¡ ʹimagemagickк׼飺
identify -verbose image.gif
㷢ͼƬֻõ4ɫڵɫʾ256ɫɫۣôͼƬͻѹĿռ䡣
԰GIFʽתPNGʽǷʡռ䡣ǿѹġ֧ޣ̫ʹPNGʽͼƬⶼǹȥˡֻһPNGʽеalphaͨ͸⣬ͬģGIFҲʸʽҲְ֧͸GIFģPNGPNG8ͬҲ˶򵥵԰ȫذGIFʽתΪPNGʽ
convert image.gif image.png
Ҫ˵ǣPNGһʩչֵĻɣ
еPNGͼƬpngcrushPNGŻߣ磺
pngcrush image.png -rem alla -reduce -brute result.png
еJPEGͼƬjpegtran߿ԶͼƬеijֵľݵͬʱŻͼƬеעԼϢEXIFϢ
jpegtran -copy none -optimize -perfect src.jpg dest.jpg

30ŻCSS Spirite

SpiriteˮƽͼƬֱлļС
SpiriteаɫϽһԽɫ״ǵ256ɫԱPNG8ʽ
ƶҪSpiriteͼмнϴ϶ȻļСû˵ҪٵڴͼƬѹΪصͼ100x100ͼƬΪ1أ1000x1000100ء

31ҪHTMLͼ
     ҪΪHTMLóʹñʵҪͼƬҪ
<img width="100" height="100" src="mycat.jpg" alt="My Cat" />
ôͼƬmycat.jpgӦ100x100ضǰһ500x500صͼƬСʹá

32favicon.icoҪСҿɻ
     favicon.icoλڷĿ¼µһͼƬļDZضڵģΪʹ㲻ǷãҲòҪһ404 Not FoundӦͬһ̨ϣÿһcoockieͻᱻһΡͼƬļӰ˳IEеonloadļʱfaviconЩݱǰء
     ˣΪ˼favicon.icoı׶ˣҪ

ļСС1K
ʵʱҲ㲻Ҫٻfavicon.icoʱΪļʱܶΪExpiresļͷԺܰȫذExpiresļͷΪδļ¡ͨ˶Եǰfavicon.icoϴα༭ʱжϡ
Imagemagick԰㴴Сɵfavicon

33ֵС25K
     ҪΪiPhoneܻ25KļעָǽѹĴСڵgizpѹܴﲻҪ˾ļԵʮҪ
     鿴ϢWayne SheaTenni TheurerļPerformance Research, Part 5: iPhone Cacheability - Making it Stick

34ɸı
     ҳݴɸıͬж฽EmailܹʹһHTTPȡöмǣHTTPǺݳ޵ģʹʱҪȷûǷ֧֣iPhoneͲ֧֣

Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ
߳³ht 2014-9-19 22:21:17
| ʾȫ¥
2F
360ʿ 360ɱ 360 ȫƹ ްװ ƹ㷽ʽ ᡿
7654(http://t.cn/RvSHpUx) ϺչƼ޹˾װˣעʽ1000Ŀǰͬ360ٶ
ɽѹȹ˾ƹ㳤սԺϵ
360ʿ 2Ԫ/
360ɱ  2Ԫ/
360  1.5Ԫ/
뷨  0.3Ԫ/
Ӱ  0.3Ԫ/
   0.2Ԫ/
ѺӰ  1.8Ԫ/
PPTV   1.5Ԫ/
  0.5Ԫ/
ƤƤӰ 1Ԫ/
WPS  0.5Ԫ/
UC  0.5Ԫ/
  3Ԫ/
ٶɱ  1.1Ԫ
ٶʿ  1.1Ԫ
ٶ 1.1Ԫ
hao123 65Ԫ/1000IP
עַ(̳ʹöַ)http://t.cn/RvSHpUx
дװQ:739=559=406












˾ڸ߼ HAO123 ɽ 360ȵ ٳ  ṩٷͳƺ̨
2345 ѹ  ٶֳ  ѹǧ
ʵˢšϵQ:739=559=406
ƻϵͳעַ
http://url.cn/AxTPpq
׿ϵͳעַhttp://url.cn/FfodQc
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
߳³ht 2014-10-15 19:41:52
| ʾȫ¥
3F
۹ٷһ˺  ڸ߼  ϵͳװ  ٳ  Ӫ
360PC˵hao.360.cn߼ܽ½ᡣ
hao123PC˵ hao123.com ߼ܽ½ᡣ
360ƶm.360.cn)360ֻ˵߼½ᡣ
PC˰ٶ  ѹ  ֳ  ½
PC ٶɱ ٶʿװ  սܽ½
׿ƻ appװ  ܽ½
ϵ**739=559=406   Ӯ  












˾ڸ߼ HAO123 ɽ 360ȵ ٳ  ṩٷͳƺ̨
2345 ѹ  ٶֳ  ѹǧ
ʵˢšϵQ:739=559=406
ƻϵͳעַ
http://url.cn/AxTPpq
׿ϵͳעַhttp://url.cn/FfodQc
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
ݼ6446 2014-10-16 12:06:31
| ʾȫ¥
4F
Ҫ,¥ͷDz
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
б

ֹ

²

̳¡ͼƬѷϴվԭתԻ,µİȨԭ
վַİȨ֪ͨǵĹԱ,Ա(Email:admin@websjy.com)ʱȡȨɾ
ܾκκʽڱ̳л񹲺͹ִ!

QQ| 42011102000510|Archiver|ֻ|Դ ( ICP14013341-1

GMT+8, 2018-6-21 09:00

Powered by Discuz! X3.2

ԴԴվ  ԴAPPӦ֮

ٻظ ض б