ä»äºã®ç¹åŸŽ
Webãªããã£ãã€ã¶ãŒã¯ãåºåHTMLããã¥ã¡ã³ããã€ã³ã¿ãŒã»ããããæé©ãªãã©ãŒã ã«å€æããŸãã ç¹ã«ãCSSãã¡ã€ã«ãšJavaScriptãã¡ã€ã«ã«ã€ããŠ
head
ã»ã¯ã·ã§ã³å šäœãåæãããéçãã¹ããããå Žåããããã®éã§ç»åãé ä¿¡ããïŒç»åã®ã¢ãã¬ã¹ãå€æŽããïŒãåºåãšã«ãŠã³ã¿ãŒã®ãããããã¯ã
</body>
åã«è»¢éãããŸãïŒåã³ãé©åãªèšå®ãæå¹ã«ããïŒã HTMLãæå°åãããŸãïŒäœåãªæ¹è¡ãšã€ã³ãã³ãã¯åé€ãããã³ã¡ã³ããšãã¹ãŠã®äœåãªæåã¯åé€ã§ããŸããããããã¯ãªãœãŒã¹ã倧éã«æ¶è²»ããæäœã§ãããããã©ã«ãã§ã¯ãªãã«ãªã£ãŠããŸãïŒã
ã¢ããªãããŠã³ããŒã
code.google.com/p/web-optimizator/downloads/list
Webãªããã£ãã€ã¶ãŒã®ã»ããã¢ãã
以äžã¯ããŠã§ããªããã£ãã€ã¶ãŒããŒãžã§ã³0.4.9.7ã§äœ¿çšå¯èœãªèšå®ã§ãïŒå€æŽãªãã§0.5ã«ãªããŸãïŒã
- ãã£ã¬ã¯ããªã®ãã£ãã·ã¥ ã ããã§ãïŒãã¡ã€ã«ã·ã¹ãã äžã®ïŒãã£ãã·ã³ã°ãã£ã¬ã¯ããªãžã®ãã¹ãèšå®ã§ããŸããä¿åãããçž®å°CSSãJavaScriptãããã³HTMLãã¡ã€ã«ãæžã蟌ãŸããŸãã ããã§ããµã€ãã®ã«ãŒããã£ã¬ã¯ããªã決å®ããããšãã§ããŸãïŒãã¹ãŠã®çžå¯Ÿãã¹ãæ£ããèšç®ããããã«å¿
èŠã§ãïŒã ããã©ã«ãã§ã¯ããã¹ãŠã®ãã£ãã·ã¥ãã£ã¬ã¯ããªã¯Webãªããã£ãã€ã¶ãŒèªäœã®
cache
ãã©ã«ããŒã«å²ãåœãŠãããŸãã - å§çž®èšå® ãã®èšå®ã°ã«ãŒãã¯ãJavaScriptãã¡ã€ã«ãšCSSãã¡ã€ã«ãçµã¿åãããŠæå°åãã圹å²ãæãããŸãã ããã©ã«ãã§ã¯ãJavaScriptãã¡ã€ã«ã¯JSMinïŒãŸãã¯
java
ãå©çšå¯èœãªå Žåã¯YUI CompressorïŒã䜿çšããŠããŒãžããã³æå°åãããŸãã Dean Edwards Packerã䜿çšããŠJavaScriptãå§çž®ããããšãã§ããŸãïŒããã¯gzip
å§çž®ããªãå Žåã«æé©ã§ãïŒã ããã§ã¯ãHTMLåºåãæå°éã«æããæ¹æ³ãæ§æããããšãã§ããŸãïŒäœåãªæ¹è¡ãã¹ããŒã¹ãç°¡åã«åé€ãã1è¡ã«ããã«ãããïŒãŸãã¯ïŒã³ã¡ã³ããåé€ããŸãïŒã IEã®æ¡ä»¶ä»ãã³ã¡ã³ãã¯ããŸã£ãã圱é¿ãåããŸããã - å€éšJavaScriptãã¡ã€ã«ãå«ããŸã ã Webãªããã£ãã€ã¶ãŒã¯ãå€éšJavaScriptãã¡ã€ã«ïŒä»ã®ãã¡ã€ã³ããåŒã³åºãããïŒããã³å
éšã³ãŒãïŒ
<script>
çŽæ¥å²ãŸããŠããïŒãããŒãã§ããŸãã ããã§ã¯ã<style>
ïŒããã©ã«ãã§æå¹ïŒã«ããCSSã³ãŒãã®ãæ¥çããèšå®ã§ããŸãã çµåããžãã¯ããé€å€ããå¿ èŠããããã¡ã€ã«åïŒãã«ãã¹ã§ã¯ãªãååïŒãïŒã¹ããŒã¹ãä»ããŠïŒæå®ããããšãã§ããŸãã ãã¹ã段éã§ãTiny MCEãšFCE Editorã®ãœãŒã¹ã©ã€ãã©ãªãçµã¿åãããããšã¯äžå¯èœã§ããããšãããã£ããããããã©ã«ãã§ã¯é€å€ãããŠããŸãã - æ§ãããªJavaScript ã ãã®ã°ã«ãŒãã«ã¯ãããŸããŸãªJavaScriptãªãã·ã§ã³ã®èªã¿èŸŒã¿ããããã¯ããªãããã«ããèšå®ãå«ãŸããŸãã ç¹ã«ãçµåãããJavaScriptãã¡ã€ã«ã
<body>
åã«åºãïŒãŸãã¯DomContentLoaded
ã€ãã³ãã§åŒã³åºãããã«åŒã³åºãïŒããšãã§ããŸãããŸããããã¥ã¡ã³ãã®äžçªäžïŒJavaScriptã³ãŒãã®åŸãçµæã®HTMLã³ãŒãããœãŒã¹ã«æ¿å ¥ãããïŒã§ãã«ãŠã³ã¿ãŒãåºåããŠã£ãžã§ããã®èªã¿èŸŒã¿ãè¡ãããšãã§ããŸãã¡ã€ã³ã³ã³ãã³ããèªã¿èŸŒãŸããåŸãè¿œå ã®åºåãŠããããåŸã ã«è¡šç€ºãããããã«ããããã®ããŒãžäžã®ã¹ããŒã¹ã - æéã®å€æŽã確èªããªãã§ãã ãã ã ãã®èšå®ã«ãããåããŒãžãèªã¿èŸŒããšãã«ãã¹ãŠã®ãã¡ã€ã«ã®æéãšã³ã³ãã³ãããã§ãã¯ããããã£ãã·ã¥ãããããŒãžã§ã³ã®ååšã®ã¿ããã§ãã¯ã§ããŸãã ãã®ããããµãŒããŒã®ããã©ãŒãã³ã¹ãå€§å¹ ã«åäžããŸãïŒããã©ã«ãã§ã¯ãèšå®ã¯æå¹ã«ãªã£ãŠããŸãïŒã å ã®JavaScriptãã¡ã€ã«ãŸãã¯CSSãã¡ã€ã«ããããã°ãããé »ç¹ã«å€æŽãããããå Žåã¯ãèšå®ãç¡å¹ã«ããããšããå§ãããŸãã
- Gzipå§çž®ïŒã¢ãŒã«ã€ãïŒ ã ãã®èšå®ã°ã«ãŒãã¯ããã©ãŠã¶ã«JavaScriptãCSSããŸãã¯HTMLãã¡ã€ã«ãã¢ãŒã«ã€ããšããŠæäŸãããã©ãããå¶åŸ¡ããŸãã Gzipå§çž®ã䜿çšãããšãããã¹ããã¡ã€ã«ã転éãããšãã«ãã©ãã£ãã¯ã®70ã85ïŒ
ãç¯çŽã§ããŸããããµãŒããŒã«æé©ã§ã¯ãªãå ŽåããããŸãïŒç¹ã«ãPHPããã³é«è² è·ãããžã§ã¯ãã«ããå§çž®ã®å ŽåïŒã ãããã®å Žåã§ããå¯èœãªéãããã¹ãŠã®å§çž®èšå®ã¯
.htaccess
è¡ãããŸãïŒCSSããã³JavaScriptã®éç圢åŒïŒã.htaccess
ãå€æŽã§ããªãå ŽåãJavaScriptããã³CSSã³ãŒã.htaccess
gzipããŒãžã§ã³ã¯ãã£ãã·ã³ã°ãã£ã¬ã¯ããªã«ä¿åãããŸããããã«ãããCPUè² è·ãæå°éã«æããããŸãïŒPHPçµç±ïŒã - æ°žé ã®ãã£ãã·ã³ã° ã ãã®ã°ã«ãŒãã®èšå®ã¯ãJavaScriptãCSSãHTMLããŸãã¯éçãã¡ã€ã«ïŒç»åãšã¢ãã¡ãŒã·ã§ã³ïŒã®ãã£ãã·ã¥ããããŒã®èšå®ãæ
åœããŸãã ç»åãšã¢ãã¡ãŒã·ã§ã³ã®å Žåã察å¿ããã«ãŒã«ã¯
.htaccess
ã«ã®ã¿é 眮ãããä»ã®ãã¡ã€ã«ã®å Žåãå¿ èŠã«å¿ããŠPHPãä»ããŠè€è£œãããŸãã æ¢å®ã§ã¯ãéçãã¡ã€ã«ã®ãã£ãã·ã¥æéã¯10幎ã«èšå®ãããŠããŸãïŒãã¡ã€ã«ãå€æŽããå Žåãæ°ããããŒãžã§ã³ã¯ãã¡ã€ã«ã®å 容ã®md5ããã·ã¥ã«åºã¥ããŠäœæãããç°ãªãååãæã¡ãŸãïŒã HTMLãã¡ã€ã«ã®å Žåãã¯ã©ã€ã¢ã³ããã£ãã·ã¥ã®é©åãªæå¹æéãæåã§èšå®ã§ããŸãã ãã®èšå®ãšæ¬¡ã®ã°ã«ãŒãïŒHTMLãã¡ã€ã«ã®ãµãŒããŒåŽã®ãã£ãã·ã¥ïŒã®éãã¯ãåºåHTMLããµãŒããŒã«ä¿åãããªãããšã§ããç¹å®ã®æéãHTMLããã¥ã¡ã³ããåèŠæ±ã§ããªãããšããã©ãŠã¶ãŒã«äŒããã ãã§ãã ãã©ãŠã¶ããã®æ瀺ã«åŸããã©ããã¯ãå®å šã«è¯å¿ã«ããã£ãŠããŸãã - HTMLãã¡ã€ã«ã®ãã£ãã·ã¥ ã ãµãŒããŒåŽãå€§å¹ ã«é«éåããã«ã¯ãã»ãšãã©ãã¹ãŠã®å ŽåããµãŒããŒã®ãã£ãã·ã¥ãå¿ èŠã§ãã ãããŠãã»ãŒãã¹ãŠã®CMSãããããµããŒãããŠããŸãïŒããã¬ãã«ãŸãã¯å¥ã®ã¬ãã«ã§ïŒã Webãªããã£ãã€ã¶ãŒã¯ä»£æ¿æ段ãæäŸããŸãïŒçŸåšã®ã·ã¹ãã ãæ¹æ³ãç¥ããªãå ŽåããŸãã¯ãããå³ããããœãªã¥ãŒã·ã§ã³ãå¿ èŠãªå ŽåïŒïŒHTMLããã¥ã¡ã³ãã®åçŽãªãã£ãã·ã¥ã ãã®èšå®ãæå¹ã«ãããšãHTMLãã¡ã€ã«ã¯ãã£ãã·ã¥ãã£ã¬ã¯ããªã«ä¿åãããã·ã¹ãã ã®å éšããžãã¯ãåŠçããããšãªããWebãªããã£ãã€ã¶ãŒã®æåã®åŒã³åºãæã«ã¬ã³ããªã³ã°ãããŸãã åœç¶ããã£ãã·ã¥ã®æå¹æéãèæ ®ãããŸãã ãŸããããã¥ã¡ã³ãå šäœã§ã¯ãªããæåã®1ã2 KBãïŒããã¥ã¡ã³ãã®ãªã»ãããä»ããŠïŒããã«çºè¡ããæ®ããèšç®ããããšãã§ããŸãã ããã¯ãäžéšã®ç°å¢ã§ããŒãžã®èªã¿èŸŒã¿ãèŠèŠçã«é«éåããã®ã«åœ¹ç«ã¡ãŸãã ãã£ãã·ã³ã°ãèšå®ããã«ã¯ãé€å€ããå¿ èŠããããµã€ãã®URLã®éšåã®ãªã¹ãïŒæ£èŠè¡šçŸãèšå®ããããšãå¯èœïŒãšããã£ãã·ã³ã°ãã¡ã€ã«ã®é ä¿¡ã匷å¶ããå¿ èŠãããããããã®ãªã¹ãïŒUSER AGENTSïŒã䜿çšã§ããŸãã
- CSSã¹ãã©ã€ã ããããããŠã§ããªããã£ãã€ã¶ãŒã®æãæè¡çã«åŒ·åã§æãç©è°ãããããŠããéšåã§ãã ã¹ãã©ã€ããæ£ãã䜿çšãããšãæ¡éãã«ïŒïŒïŒå€æ°ã®èæ¯ç»åïŒ20ã100ã3ã10ïŒãå«ãããŒãžãèªã¿èŸŒããšãã«ãµãŒããŒãžã®ãªã¯ãšã¹ãæ°ãæžããããšãã§ããŸãã ãã ããIE6ã®çµåç»åã®è¡šç€ºã«ã¯ããã€ãã®åé¡ãããïŒããã©ã«ãã§ã¯ãç»åã¯32ããããã¬ããã§äœæãããIE6ã¯ãã®ãããªPNGã®éæ床ãæ£ããåŠçã§ããŸããïŒãIE6ãã¹ãã©ã€ãã®äœæããé€å€ããïŒé©åãªèšå®ã䜿çšïŒããäžéæãªç»åã䜿çšããããšã§åé¡ã解æ¶ãããŸãã ãã«ã«ã©ãŒç»åã«PNGã®ä»£ããã«JPEGã䜿çšããããã®èšå®ãå©çšã§ããŸãããã¢ã°ã¬ãã·ããã¢ãŒãïŒã³ã³ããã®å®éã®ãµã€ãºãèæ
®ããã«
repeat-x
ãšrepeat-y
ãçµã¿åããããŸãïŒã空ãã¹ããŒã¹ãè¿œå ããŸãïŒçŸä»£ã®ãã©ãŠã¶ã§ãã®ãããªç»åãã¹ã±ãŒãªã³ã°ãããšãã«åºæ¬ãé¿ããŸãïŒã
å®å®æ§ãåäžãããããã«ããå¶éä»ããã¡ã¢ãªã¢ãŒããè¿œå ãããŸãããPHPããã»ã¹ã®ã¡ã¢ãªã64 MBæªæºã®å ŽåïŒããã¯ãçŽ3000 x 3000ãã¯ã»ã«ã®ã¹ãã©ã€ããäœæããã®ã«ååã§ãã»ãšãã©ã®ãµã€ãã§ååã§ãïŒã4000ãã¯ã»ã«ã®å€§ããªé åã®ç»åã¯é€å€ãããŸãã ãŸããCSSã¹ãã©ã€ãã®äœæããã»ã¹ããç·åœ¢ãµã€ãºïŒããã©ã«ãã§ã¯900ïŒã§å€§ããªç»åãé€å€ãããã¡ã€ã«ïŒãã¡ã€ã«ãžã®ãã«ãã¹ã§ã¯ãªããã¡ã€ã«åãèšå®ïŒãçŽæ¥é€å€ããèšå®ããããŸãã - ããŒã¿ïŒURI
data:URI
ãã¯ãããžãŒã䜿çšãããšãCSSãã¡ã€ã«ã«èæ¯ç»åãçŽæ¥å«ããããšãã§ããŸãã ææ°ã®ãã¹ãŠã®ãã©ãŠã¶ãŒãšIE8ã§ãµããŒããããŠããŸãã ç»åãµã€ãºã«ã¯24 Kbã®å¶éããããŸãïŒ32 Kbdata:URI
ã³ãŒãdata:URI
ã¯24576ãã€ãã®ãã€ããªã³ãŒãããååŸãããŸãïŒãdata:URI
äœæããdata:URI
IE7ããã¯ã®data:URI
ã¯CSSãã¡ã€ã«ã«æ¿å ¥ãããããããããã®ãã©ãŠã¶ãŒã®ãµã€ãèšèšã¯å€æŽãããŸããã ãŸããdata:URI
äœæããdata:URI
ç»åãæé©åããããšãéåžžã«æãŸããã§ãã ããã«ã¯ã smush.itã®API ã䜿çšãããŸãã æ£ããç»åã®æé©åã«ã¯ãç»åèªäœã«å¯ŸããWebãµãŒããŒã®æžã蟌ã¿æš©éãå¿ èŠã§ãã ãã®èšå®ã¯ããã©ã«ãã§ã¯ç¡å¹ã«ãªã£ãŠããŸããããã¯ãç»åã1åã ãæé©åããåŸç¶ã®çµæãCSSãã¡ã€ã«ã®åŸç¶ã®ãã«ãã«äœ¿çšããããšãçã«ããªã£ãŠããããã§ãã - è€æ°ã®ãã¹ã ã ãã®èšå®ã«ãããéçãã¹ãã§ã®ã€ã¡ãŒãžã®é
åžãæå¹ã«ã§ããŸãã 1ã€ã®ã€ã¡ãŒãžã¯åžžã«åã€ã¡ãŒãžã«å¯Ÿå¿ããŸãïŒäœ¿çšå¯èœãªãã¹ãŠã®ãã¹ãããã®åãã€ã¡ãŒãžã§ãã£ãã·ã¥ãè©°ãŸãã®ãé²ãããïŒã ãã®ã¡ã«ããºã ã䜿çšããŠããŒããé«éåããã«ã¯ããã¹ãŠã®ä»£æ¿ãã¹ããæäŸããIPã¢ãã¬ã¹ïŒéåžžã¯çŸåšã®ãµã€ãïŒã«DNSã§ç»é²ãããããã®ãã¹ãã®åœ¢åŒã§ãµãŒããŒæ§æã®ã¡ã€ã³ãµã€ãã®ãšã€ãªã¢ã¹ãè¿œå ããå¿
èŠããããŸãã äŸïŒ
ãã®åŸãServerAlias i1.site.ru ServerAlias i2.site.ru
i1 i2
ãWebãªããã£ãã€ã¶ãŒã®ãã¹ãã®ãªã¹ãã«è¿œå ãããããã®ãã¹ãã§ã€ã¡ãŒãžããæ£ä¹±ããããŠããããšã確èªã§ããŸãã Webãªããã£ãã€ã¶ãŒãã€ã³ã¹ããŒã«ãããšãå€æ°ã®ãã¹ãã代æ¿ãµã€ããšããŠïŒãµã€ãã®åãã«ãŒãã§ïŒäœ¿çšã§ãããã©ãããèªåçã«ç¢ºèªãããæåã§æå®ããããã¹ãŠã®ãã¹ãã®å¯çšæ§ã確èªãããŸãïŒãã¹ãã€ã¡ãŒãžã¯ãããããããŠã³ããŒããããŸãïŒã ãå®å šãªãã€ã³ã¹ããŒã«ïŒå°ãåŸïŒããªã³ã«ãããšããã¹ãã®ãã§ãã¯ã䜿çšã§ããªããªããWebãªããã£ãã€ã¶ãŒã®èšå®ãåèµ·åããã«æåã§ãã¹ããç»é²ããå¿ èŠãããããšã«æ³šæããŠãã ããã -
.htaccess
ã䜿çšããŸãã gzipã®å§çž®ãšãã£ãã·ã³ã°ã®èšå®ã®ã»ãšãã©ã¯ããµãŒããŒåŽã®ã¹ã¯ãªããã§ã®è¿œå äœæ¥ãé¿ããããã«ããµãŒããŒã®æ§æãã¡ã€ã«ã«æžã蟌ãããšãã§ããŸãã ããã¯.htaccess
ãã¡ã€ã«ã䜿çšããŠå®è¡ã§ããŸãïŒå¿ èŠãªå Žåã¯ãåŸã§ãã¹ãŠã®èšå®ãhttpd.cond
ãã¡ã€ã«ã«è»¢éã§ãhttpd.cond
ïŒã Webãªããã£ãã€ã¶ãŒã¯äœ¿çšå¯èœãªã¢ãžã¥ãŒã«ãèªåçã«ãã§ãã¯ããã§èšé²ãæ§æã. htaccess
. htaccess
ïŒåœç¶ããã®ããåŸè ã¯æžã蟌ã¿å¯èœã§ãªããã°ãªããŸããïŒãmod_gzip
ãmod_deflate
ããã³mod_filter
ã¯ããã¡ã€ã«ããªã³ã¶ãã©ã€ã§å§çž®ããmod_rewrite
ããã³mod_mime
ã¯ãéçã¢ãŒã«ã€ããè¡ããŸããmod_headers
ããã³mod_setenvif
ãããã·ãµãŒããŒããã³å€ããã©ãŠã¶ã§å§çž®ãã¡ã€ã«ãæ£ããåŠçãããããmod_expires
ãã£ãã·ã³ã°ã€ãŒã°ã«ã®èšå®çšã.htaccess
ãµã€ããã£ã¬ã¯ããªïŒããã¯ãè€æ°ã®ãµã€ããåããã¹ãã®ç°ãªããã£ã¬ã¯ããªã«ããå Žåã«äŸ¿å©ïŒãŸãã¯ãµã€ãã®ãŸãã«ã«ãŒãã«é 眮ããããšãã§ããŸãã ããã©ã«ãã§ã¯ãäž¡æ¹ã®å Žæã¯åãã§ãã.htpasswd
ãWebãªããã£ãã€ã¶ãŒã®ã€ã³ã¹ããŒã«ãä¿è·ããããšãã§ããŸãã ãã®å Žåãèšå®ã«ã¢ã¯ã»ã¹ããã«ã¯ããã©ãŠã¶ãŒã®HTTPåºæ¬èªèšŒãŠã£ã³ããŠãããŠãŒã¶ãŒåãšãã¹ã¯ãŒããå ¥åããå¿ èŠããããŸãïŒããã«ãããä¿è·ãããé åå€ã«ãã£ãã·ã¥ãã£ã¬ã¯ããªãé 眮ããåŸãWebãªããã£ãã€ã¶ãŒããµã€ãå ã®ä»»æã®ãã£ã¬ã¯ããªã«ç§»åã§ããŸãïŒã - Webãªããã£ãã€ã¶ãŒã®ã㎠ã çŸæç¹ã§ã¯ããã®ã°ã«ãŒãã®èšå®ã¯äžå䜿çšãããŠããŸããã å°æ¥çã«ã¯ããããžã§ã¯ããžã®ãªã³ã¯ãèšèŒããããWeb Optimizerã«ããå éããšããå°ããªæŽ»åãåãµã€ãã«è¿œå ãããã§ãããã ãããããããŸã§ã®ãšããããã®ãããã¯ã«é¢ãã決å®ã¯è¡ãããŠããŸããã
-
/index.php
èªåçã«å€æŽã/index.php
ã Webãªããã£ãã€ã¶ãŒã¯ãæ°ååã®CMSã®æ£ããæäœã«å¿ èŠãªãã¡ã€ã«ã®èªåå€æŽããµããŒãããŠããŸãïŒäžæãªã·ã¹ãã ã®å Žåããã®ååã¯CMS 42ãšããŠè¡šç€ºãããã«ãŒãindex.php
åžžã«å€æŽãããŸãïŒã ãã¡ã€ã«ãèªåçã«å€æŽããåã«ããµã€ãã®ãã§ãŒã³æé©åãéå§ããããã¹ãŠã®ãã£ãã·ã¥ãã¡ã€ã«ãäœæãããã¡ã€ã³ããŒãžã®ååã®é·æéã®èªã¿èŸŒã¿ãåé¿ãããŸãã
䜿çšäŸ
Web Optimizerã¯ããããããµã€ãã®ã¯ã©ã€ã¢ã³ãæé©åã®ããã®åŒ·åã§æè»ãªããŒã«ã§ãã ãã ããé©åã«èª¿æŽããã«ã¯ã泚æãæããç®çã®çµæãç解ããå¿ èŠããããŸãã ããã©ã«ãèšå®ã«å¯Ÿããæãäžè¬çãªå€æŽã®ããã€ããèŠãŠã¿ãŸãããã
- ãã¹ãŠã®ããŒãžã«å
±æJavaScriptãã¡ã€ã«ãŸãã¯CSSãã¡ã€ã«ãå«ãŸããŸã ã å€ãã®å Žåããµã€ãå
šäœã«å¿
èŠãªãã¹ãŠã®ããŒãžã«å
±éã®JavaScriptã©ã€ãã©ãªãŸãã¯ã¹ã¿ã€ã«ã·ãŒããæ¿å
¥ã§ããŸãã Webãªããã£ãã€ã¶ãŒããã®å
±éãã¡ã€ã«ãä»ã®ãã¹ãŠã®ãã¡ã€ã«ãšããŒãžããªãããã«ããã«ã¯ãæ§æã§é€å€ããããšãã§ããŸãã
å€éšJavaScriptãã¡ã€ã«ãšåã蟌ã¿ã³ãŒããå«ãã->ããŒãžãããã¡ã€ã«ãé€å€ãã->ãã¡ã€ã«ã®ã³ã³ãåºåããªã¹ã
- CSSã¹ãã©ã€ããç¡å¹ã«ããŸãã ããã€ãã®çç±ïŒãã¹ãã£ã³ã°ã§ã®GDLibã®é©åãªãµããŒãã®æ¬ åŠãã¡ã¢ãªã®å¶éãªã©ïŒã«ãããCSSã¹ãã©ã€ããäœæããããšãããšããã©ãŠã¶ãŒã«ãçœãç»é¢ãã衚瀺ãããïŒãããŠãµã€ããéããªããªãïŒå ŽåããããŸãã ãã®ãããªå ŽåãCSSã¹ãã©ã€ããå®å
šã«ç¡å¹ã«ãããšãé垞次ã®ããšã圹ç«ã¡ãŸãã
å¿ èŠã«å¿ããŠãæå°åãããCSSãã¡ã€ã«ïŒãŸãã¯ããŒãžããããœãŒã¹ïŒãæå®ããããšã«ããã Auto Spritesã䜿çšããŠCSSã¹ãã©ã€ããæåã§äœæã§ããŸããCSSã¹ãã©ã€ã-> CSSã¹ãã©ã€ããé©çš->ããã
- IE6ã§ã®ãµã€ãã®èª€ã£ã衚瀺 ã ãã®å ŽåãIE6ã®ã¹ãã©ã€ããç¡å¹ã«ããã ãã§æ¬¡ã®ããšãã§ããŸãã
IE6ãã¹ã¿ã€ã«ããŒãžïŒããã³ä»ã®å€ãã®ããã¯ãšäžç·ã«èæ¯ãªãŒããŒã¬ã€ïŒãæ£ããåŠçããªãå¯èœæ§ããããŸãã ãã®åŸãCSSã¹ãã©ã€ã-> CSSã¹ãã©ã€ãäœæããã»ã¹ããIE6ãïŒããã¯çµç±ã§ïŒé€å€->ã¯ã
data:URI
ç¡å¹ã«ãdata:URI
ãŸãã¯ãCSSãã¡ã€ã«ãçµã¿åãããŸãïŒããŒã¿ïŒURI->ããŒã¿ã®é©çšïŒURI-> no
å§çž®èšå®-> CSSãã¡ã€ã«ã®æå°åãšçµå->ããã
- å®å
šãªã€ã³ã¹ããŒã« ã Web Optimizerã¯ãä»»æã®ãã£ã¬ã¯ããªïŒãµã€ãå
ïŒã«ã€ã³ã¹ããŒã«ã§ãã
htpasswd
ãä»ããŠãã¹ã¯ãŒãã§ä¿è·htpasswd
ãŸãã ãããè¡ãã«ã¯ã以äžãå«ããŸãã
åæã«ã.htaccessã®äœ¿çš-> htpasswdã§Webãªããã£ãã€ã¶ãŒã®ã€ã³ã¹ããŒã«ãä¿è·->ã¯ã
ãWebãªããã£ãã€ã¶ãŒèªäœã®ãããã©ã«ããŒã®å€åŽã«ããããšã確èªããå¿ èŠããããŸãïŒããã§ãªãå Žåãèªå以å€ã®ãµã€ããžã®ãã¹ãŠã®èšªåè ã«ãšã£ãŠãã¹ãŠãã°ãã°ãã«ãªããŸãïŒã - éçãµã€ãã®æ¥ç¶ ã Webãªããã£ãã€ã¶ãŒã¯ãPHPãå©çšå¯èœãªãã¹ãŠã®ãµã€ãã§äœ¿çšã§ããŸãã æ¢ã«éçãµã€ããããå Žåã¯ãåããŒãžã®æäžéšïŒãŸãã¯
index.php
ïŒã§Webãªããã£ãã€ã¶ãŒåŒã³åºããæ¥ç¶ã§ããŸãã
ãããŠãããŒãžã®äžçªäžã§ïŒ<ïŒphp requireïŒ/path/k/Web/Optimizer/web.optimizer.phpïŒ; ïŒ>
ã¹ã±ãžã¥ãŒã«ã¢ãŒãïŒãã¹ãŠã®ãã£ãã·ã¥ãã¡ã€ã«ãäœæããåŸïŒã§ã¯ãWebãªããã£ãã€ã¶ãŒããžãã¯ã®å®è¡ã«5ã10ããªç§ããããããããŠã³ããŒãã®ãµãŒããŒåŽã«ã¯åœ±é¿ããŸããããã¯ã©ã€ã¢ã³ãã¯å€§å¹ ã«é«éåãããŸãã Webãªããã£ãã€ã¶ãŒãžã®åŒã³åºããè¿œå ããããŒãžããPHPã€ã³ã¿ãŒããªã¿ãŒãä»ããŠåŠçãããããšã確èªããå¿ èŠããããŸãïŒãµãŒããŒèšå®ã«ãã£ãŠæ±ºå®ãããæ¡åŒµå<ïŒphp $ web_optimizer-> finishïŒïŒ; ïŒ>
.php
ãŸãã¯ãã®ä»ã®ãã®ããããŸãïŒã - ã¹ã±ãžã¥ãŒã«ãããæé©å ã ãã§ã«ãWebãªããã£ãã€ã¶ãŒã¯ããéçãã¢ãŒãã§ä»»æã®ãµã€ãã®å
¬éã¹ããŒã ã«çµ±åã§ããŸãã ãããè¡ãã«ã¯ãWebãªããã£ãã€ã¶ãŒãã€ã³ã¹ããŒã«ãããŠãããµã€ãã®ãã¹ãŠã®ããŒãžãéãã衚瀺ãããHTMLããã³ãã£ãã·ã¥ãã£ã¬ã¯ããªãã³ããŒããã ãã§ãã Web Optimizerã
dev.site.ru
ã€ã³ã¹ããŒã«ãããŠãããšãdev.site.ru
ããšãã°ãwget
å®è¡ããããšã«ãã
ãµã€ãã®æé©åãããããã£ã¹ãããååŸããŸããããã¯æ¢ã«åäœäžã®ã·ã¹ãã ã«ããŠã³ããŒãã§ããŸããwget -d -r -c http://dev.site.ru/
- HTMLã1è¡ã§çµåããŸã ã ãã§ã«äžã§èª¬æããããã«ãWebãªããã£ãã€ã¶ãŒã¯ãã¹ãŠã®HTMLåºåã1è¡ã§ãããŒãžãã§ããŸãã ãããè¡ãã«ã¯ãæå¹ã«ããŸã
ãããã®èšå®ã¯ãµãŒããŒã«äœåãªè² è·ãè¿œå ããããšã«æ³šæããŠãã ããïŒæ£ããæ£èŠè¡šçŸã¯éåžžã«ãªãœãŒã¹ãæ¶è²»ããŸãïŒããŸããJavaScriptã³ãŒãïŒã³ã¡ã³ããä»ããŠæ¿å ¥ãããŸãïŒãåé€ããå¯èœæ§ããããŸãã ãŸããå§çž®èšå®-> HTMLã1è¡ã«å§çž®->ã¯ã å§çž®èšå®-> HTMLã³ã¡ã³ãã®åé€->ã¯ã
script
ãtextarea
ãpre
å ã®ã³ãŒãã¯å€æŽãããŸããïŒä»æ§ã«æºæ ïŒã ãããã£ãŠããããã®èšå®ã¯æ éã«äœ¿çšããŠãã ããã - smush.itã«ããç»åã®æé©å ã Smush.itã¯Yahoo!ãšã³ãžãã¢ã«ãã£ãŠéçºãããŸãã Googleã䜿çšãããšãèªåã¢ãŒãã§èæ¯ç»åã®ãµã€ãºãæé©åã§ããŸãã CSS Spritesã©ã€ãã©ãªã䜿çšããŠç»åã®æé©åãæå¹ã«ã§ããŸãïŒããŒãžã§ã³0.4.9.7ã®ãã®äŸã¯ãŸã æ©èœããŸããããSVNã§æ¢ã«å©çšå¯èœã§ããã0.5ã«å«ãŸããŠããŸãïŒã
çµæãšããŠãã€ã¡ãŒãžã®ä»£ããã«ïŒå€æŽããæš©å©ãããå ŽåïŒãæé©åãããã³ããŒãååŸããŸãã ã°ã«ãŒãã§äœæ¥ç»åãå®è¡ããã®ã§ã¯ãªããã°ã«ãŒãã®ã³ããŒã§å®è¡ããŠãå€æŽãããŒã«ããã¯ã§ããããã«ããããšããå§ãããŸãã<ïŒphp requireïŒ '/ full / path / to / css.sprites.php'ïŒ; $ smushit = new css_spritesïŒïŒ; $ smushit-> smushitïŒ '/ full / path / to / image'ïŒ; ïŒ>
ã¢ããªãããŠã³ããŒã
code.google.com/p/web-optimizator/downloads/list