JavaScriptãcssãgzipå§ç¸®ã»è»¢é
prototype.jsã大ããï¼ã¨ãããã¨ã§ãgzipå§ç¸®ãã¦ä½¿ããã¨ã«ãã¾ãã
以åãã£ããã§ããã©ããã£ããå¿ãã¦ãã¾ã£ã¦ããã®ã§ã¡ã¢
ããã¯
1.htmlã®ã½ã¼ã¹ã¯ããããªãï¼æ¬æ¥ã®.jsãæå®ããã¾ã¾ï¼
2.æ¬æ¥ã®.jsã®ãã¡ã¤ã«ã¨åããã£ã¬ã¯ããªã«å§ç¸®ãããã¡ã¤ã«ï¼.js.gzï¼ãã¢ãããã¼ã
3..jsã®ãã¡ã¤ã«ã¨åããã£ã¬ã¯ããªã«.htaccessãç½®ãã¦ãmod_rewriteã使ãæå®ã
ãAccept-Encodingã«gzipãå«ããã©ããã§.jsã¨.js.gzãæ¯ãåã
ã§ããã
æã®ã¡ã¢ããã¨ã«ã以ä¸ã®è¨äºãé çªã«èªãã¨ãã£ããæãåºãã¾ããã
â½ä¸çã®çé
ã§.jgzã¨è¨ã£ã¦ã¿ãï¼ãã¶ãã®ã©ããï¼
ãhttp://smil.exblog.jp/4650470/
â½prototype.jsã10KBã«ããæ¹æ³ã®ç¶ãï¼äºç´°äºãè¾ - Weblogï¼
ãhttp://asiamoth.com/mt/archives/2006-11/19_2357.php
â½mod_mimeã¯é»éè¡ã®ãããªæ°ãããï¼ãã¾ã«ã¯åªæãã¨ãªãã¦ã¿ããï¼ä»äºçï¼
ãhttp://cast-a-spell.at.webry.info/200610/article_4.html
â½.jgz 㨠.js.gz 㨠Apache ã®è¨å®ï¼ã¦ã³ãµã³ã®ï¼
ãhttp://blog.l-xs.com/yungsang/2006/11/jgz_jsgz_apache.html
å§ç¸®ãããã¡ã¤ã«ã¯prototype.js 1.5.1.1ã§ãã
ä»ã®ã©ã¤ãã©ãªããå¼ã³åºãé½åä¸ãææ°çã§ãåãåä½ãããããããªãã®ã§å¤ãã®ä½¿ã£ã¦ã¾ãã
ã¾ããYUI Compressorï¼Yahoo! User Interface Libraryãæä¾ããJavaScriptå§ç¸®ãã¼ã«ï¼ãããªã³ã©ã¤ã³ã§ä½¿ãã以ä¸ã®ãµã¤ãã§ãJavaScriptãå§ç¸®ï¼ããªãã¦ãããããä»ã®ãã¼ã«ã§ããããã©ï¼ã
94.0KBâ56.3KB
â½Online JavaScript/CSS Compression Using YUI Compressor
ãhttp://refresh-sf.com/yui/
次ã«ãå§ç¸®ãããã¡ã¤ã«ãé©å½ãªã¢ã¼ã«ã¤ãã§gzipã«å§ç¸®ã
56.3KBâ16.1KB
ããã.jsã¨åããã£ã¬ã¯ããªã«ã¢ãããã¼ãã
æå¾ã«.htaccessã«ä»¥ä¸ã®è¡ã追å
RewriteEngine on
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{REQUEST_FILENAME} !\.gz$
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule .+ %{REQUEST_URI}.gzForceType text/javascript
AddEncoding x-gzip .gz
ãã£ãããã ãã
ä¸å®ã ã£ããLive HTTP headersã使ã£ã¦ç¢ºèªããã°ãContent-Lengthã®ãµã¤ãºãã.js.gzãè¿ãã¦ããã®ããããã¾ãã
cssãåããã¿ã¼ã³ã§ã§ãã¾ããã
cssãOnline JavaScript/CSS Compression Using YUI Compressorã§å§ç¸®ã§ããã®ãå¬ããã§ãããã©ããå°ãããããªãæããã£ã¦(^_^)
ãã JavaScriptã«æ¯ã¹ã¦CSSã¯æ¸ãå ãããã¨ãå¤ããããå ã®.cssãã¡ã¤ã«ãä¿®æ£ããã®ã«.css.gzãä¿®æ£ããã®ãå¿ããã¨ãããï¼çµæãåæ ãããªãã¾ã¨é ãæ±ãããã¨ã«ãªãã¾ãããã注æï¼èªåï¼ç¬ï¼
ãããã®å·¥å¤«ã§å°ãã¯ãã¼ã¸ãè¦ãéã«ã軽ãæãã¦ããããã¨ããã§ããã
â¦â¦ã¯ã©ã¤ã¢ã³ãå´ã§ããã¡ã¤ã«ãå±éããæ¹ãè² è·ãé«ãã£ããããã¨é ãããã¾ããã
ãªãmod_rewriteã使ããªãå ´åã
â½ãã©ã¦ã¶ã®ãªã¯ã¨ã¹ãã«å¿ãã¦ãäºãå§ç¸®ãã¦ãããã®ãçã®ãé¸ãã§jsãcssãé
ä¿¡ããæ¹æ³ ãApache 2.2ç·¨ã
ãï¼(ã²)ã¡ã¢ï¼
ãhttp://d.hatena.ne.jp/hirose31/20090709/1247119714
ä»ã«ã¯ãã®è¨äºãåèã«ãªãã¾ããã
JavaScriptãæ¸ããªãã®ã§ãã¿ã¤ãã³ã°ã調æ´ããã®ã¯ç§ã«ã¯é£ããã§ããããã¤ã試ã¿ã¦ã¿ãããã®ã§ãã
â½JavaScriptã®åä½ã軽ãããããã®å·¥å¤«
ãï¼æè¡è
è¦ç¹ã®ã¦ã¼ã¶ããªãã£è第30åï¼ITproï¼
ãhttp://itpro.nikkeibp.co.jp/article/COLUMN/20080109/290747/?ST=webdesign&P=1
ä¸çªã®åé¡ã¯ãèªåã®ãµã¼ãä¸ã®JavaScriptãããªãã¦Amazon.co.jpã®ããããã¯ãã¯ã©ã¦ãã¦ã£ã¸ã§ããããªãã§ããã©ãã
ããããã¯ãã¯ã©ã¦ãã¦ã£ã¸ã§ããããè¦ãç®è»½ããã§ãæ°ã«å
¥ããªã®ã«ãLive HTTP headersã§è¦ã¦ããã転éããã¦ããJavaScriptã®ãµã¤ãºã®å¤§ãããã¨ï¼ï¼å§ç¸®ããããã¦ãï¼ï¼ãã¦ãããï¼ï¼
Firefox3.5ã ã¨ããws.amazon.jpãããã¼ã¿ã転éãã¦ãã¾ããã¨è¡¨ç¤ºããã¦ä¸ç¬æ¢ã¾ããã§ããããã
Google Chromeã ã¨ããã»ã©ã§ããªãã®ã§ãJavaScriptã®å®è¡ã¹ãã¼ãã®åé¡ãªã®ãããã
ã¯ããã¡ããã£ããª