è¡šã¯æ å ±ã瀺ããŠããŸãããååã«ã€ããŠã¯ãå®éçãªåé¡ãéããŠèããŠã¿ãŸãããã
èªåããããžã§ã¯ãã«é©ããæ¹æ³ãéžæãããšãããããã®è³ªåã¯ãã³ããšããŠåœ¹ç«ã¡ãŸãã ãããã®è³ªåã®å€ãã¯ãããžã§ã¯ãã«é¢é£ããå¯èœæ§ããããããã©ã®ç¶æ³ã§ã©ã®ãã¯ããã¯ãåªããŠããããè©äŸ¡ãããã®ç解ãäžè¬åããå¿ èŠããããŸãã
以åã®ã³ã³ãã³ãã¯ããã€ãããŸããïŒ
å®éããã®è³ªåã¯ãæŽæ°ã§ããªãå€ãã³ã³ãã³ãããããŸããïŒããšããæå³ã§ãã ããšãã°ã
ãã...ãã®ãµã€ãã®ãã¹ãŠã®<img>
ç§ãç¥ã£ãŠããå¯äžã®ããŒã«ã¯ãããŒã¯ã¢ããã®å€æŽãäžåå¿ èŠãšããªãã¢ãããã£ãã€ã¡ãŒãžã§ãã ããã¯ãèªè ã®ç»é¢ã®å¹ ã«åã£ããµã€ãºã®ã€ã©ã¹ããã€ã³ããªãžã§ã³ãã«éžæããïŒå¿ èŠã«å¿ããŠäœæããïŒ
ãŸããå€ãã³ã³ãã³ããã©ãã ãæ°ã«ããããèªåããå¿ èŠããããŸãã ãµã€ããžã®èšªåè ã®å€§å€æ°ã¯ãæ°ããã³ã³ãã³ãã®ã¿ã«é¢å¿ããããã¬ã€ã¢ãŠãã¯æè¡çãªæ段ã䜿çšããããã«å¿ èŠãªå€æŽãå ããããšãã§ããŸãã ãããããªãããããã«ã€ããŠèª¿ã¹ãããã«èªãã§ãã ããã
å°èŠæš¡ãªãµã€ããæ°ãããµã€ããããå ŽåããŸãã¯ä»¥åã®ã³ã³ãã³ãã«ç°¡åã«æ»ã£ãŠæŽæ°ã§ããå Žåã¯ãç¹å¥ãªããŒã¯ã¢ãããå¿ èŠãªããŒã«ãéžæããããšãã§ããŸãã ããäžåºŠèªã¿çŽããŠãã ããã
ç¹å¥ãªããŒã¯ã¢ããã¯ç§ã«é©ããŠããŸããïŒ
ããã¯ãåã®è³ªåã®ãµã質åã§ãã ã¬ã¹ãã³ã·ãç»åãæäŸããå€ãã®æ段ã§ã¯ãç¹å¥ãªHTMLã³ãŒãã䜿çšããå¿ èŠããããŸãã ããšãã°ã HiSRCã®å ŽåãããŒã¿å±æ§ã«é«è§£å床ç»åã®ã¢ãã¬ã¹
<img src="200x100.png" data-1x="400x200.png" data-2x="800x400.png">
ãã®ææ³ã«ãããæ確ã§æå¹ãªãæå³çã«æ£ããã³ãŒããäœæãããŸããããããã®å±æ§ããµã€ãã®å
ç¹å¥ãªããŒã¯ã¢ããïŒãŸãã¯ç¹å¥ãªCSSã¹ã¿ã€ã«ïŒãããªãã«é©ããŠããªããšããçµè«ã«éããå Žåã ã¢ãããã£ãã€ã¡ãŒãžã®ã¿ãæ®ããŸãã çµå±ã
ã»ãã³ãã£ãã¯ã³ãŒããå¿ èŠã§ããïŒ
ã¬ã¹ãã³ã·ãç»åãäœæããããã®ãã¯ããã¯ã«ã¯ãå³å¯ãªæå³ã§ã¯ã»ãã³ãã£ãã¯ã§ã¯ãªãããŒã¯ã¢ãããå«ãŸããŸãã çµå±ã®ãšãããç»åã®ã»ãã³ãã£ãã¯ãªæ¹æ³ã¯1ã€ãããããŸããããã®srcå±æ§ã¯å®éã®ç»åãæããŠããå¿ èŠãããã altå±æ§ã«ã¯ãã®ç»åã説æããããã¹ããå«ãŸããŠããå¿ èŠããããŸãã ãã©ããã»ããã¹ãã®ç·æ¬ïŒ
ã€ãŸããç»åã®srcå±æ§ãååšããªãããéæãªGIFãªã©ãåç §ããããšããã¯ããã¯ãèŠæ±ããå Žåãã³ãŒãã¯æå³ãæã¡ãŸããã
ããŠããªãã¬ã¹ãã³ã·ãç»åãäœæããããã€ãã®æ段ãããã«é Œãã®ã§ããïŒ ã¯ããã€ã©ã¹ã
ã»ãã³ãã£ã¯ã¹ãéèŠãªå Žåã¯ãåè¿°ã®Adaptive ImagesãŸãã¯
ä»ã®äžéšã®ããŒã«ã¯
ã³ãŒãã®æå¹æ§ã¯å¿ èŠã§ããïŒ
ããã§ã®æå¹æ§ãšã¯ãã³ãŒããW3CããŒã¯ã¢ããæ€èšŒãµãŒãã¹ãã¹ãã«åæ Œããèœåã®ããšã§ãã ãã®æ€èšŒããŒã«ã¯ãåé¡ã®ããã³ãŒããèŠã€ããã®ã«åœ¹ç«ã¡ãããŒã¯ã¢ãããããè¯ãäœæããã®ã«åœ¹ç«ã¡ãŸãã ãã ãããã¹ãã«åæ Œããªããšããçç±ã ãã§ã³ãŒããæªåããããšã¯ãããŸãããç¡å¹ãªã³ãŒãããã¹ãŠã®ãã©ãŠã¶ãŒã§æ£åžžã«æ©èœããå Žåããã®æå¹æ§ã¯ããªã
ãã ããæå¹æ§ãå¿ èŠãªå ŽåïŒããšãã°ã顧客ã確å®ã«ãããèŠæ±ããä»äºã«å¯Ÿããæ¯æããæåŠãããšè è¿«ããå ŽåïŒãã¬ã¹ãã³ã·ãã€ã¡ãŒãžãæäŸããäœããã®æ段ã䜿çšããããšã¯ã§ããŸããã ããšãã°ã picturefillã¯
ã³ãŒãã®åŠ¥åœæ§ãå¿ èŠãªå Žåã¯ã Adaptive Images ã
ç»åã埮調æŽããå¿ èŠããããŸããïŒ
ã¬ã¹ãã³ã·ããªç»åãæäŸããããã€ãã®æ段ã¯ãèªè ã«åã倧ããªç»åã®æ¯èŒçå°ããªããŒãžã§ã³ãæäŸããŸãã ããã«ãã人çã¯æ¥œã«ãªããŸããïŒæ··ä¹±ã¯å°ãªããªããŸãïŒãçµæã¯åãå ¥ããããªããããããŸããã ããè¯ãã¢ãããŒãã®è¯ãäŸã次ã«ç€ºããŸãã
ããã3ã€ã®åçã®å·ŠåŽã¯æºåž¯é»è©±çšã§ãæåã¯
ãããã®ç»åã¯ãåçã®æå³ãšå°è±¡ãç¶æããããã«ããªãã³ã°ã䜿çšãããã¶ã€ããŒã®æäœãã®çµæã§ãã 代ããã«ãé©åãªåçãæ®ãããããåçŽã«æ¯äŸçž®å°ããå Žåãåçã«æãããŠãã人ã¯éåžžã«å°ãããªããã€ã©ã¹ãã®å°è±¡ã倱ãããå¯èœæ§ããããŸãã
ãããžã§ã¯ãã§ç»åã现ããå¶åŸ¡ãããšããèãæ¹ãéèŠãªå Žåã¯ãã©ã®ç¶æ³ã§ã©ã®
<picture alt="description"> <source src="small.jpg"> <source src="medium.jpg" media="(min-width: 400px)"> <source src="large.jpg" media="(min-width: 800px)"> </picture>
次ã¯JavaScriptã§ãã
JavaScriptãå¿ èŠã§ããïŒ
JavaScriptã䜿çšããŠã¬ã¹ãã³ã·ãã€ã¡ãŒãžãäœæããããã®ããŒã«ã®ã»ãšãã©ã¯ãããªãã¯ãå®è¡ããŸãã
javascriptã©ã€ãã©ãªãžã®äŸåé¢ä¿ã¯ã©ãã§ããïŒ
HiSRC
ãµãŒããŒã¹ã¯ãªãããå¿ èŠã§ããïŒ
ç§ãã¡ãè°è«ããããŒã«ã®ããã€ãã¯ãjavascriptã ãã«äŸåããŠããŸããã ã¢ãããã£ãã€ã¡ãŒãžã¯ãäž»
ã¬ã¹ãã³ã·ãã€ã¡ãŒãž ïŒãã£ã©ã¡ã³ãã°ã«ãŒãããã®æåã®ãªãªãŒã¹ïŒã.htaccessã䜿çšããŸãã ãµãŒããŒãšããŠNginxã®ãããªãã®ãããå Žåã¯ããã®æè¡ããŒã«ãæŸæ£ããããåæ§ã®Nginxæ§ææ§æã«
ãªãŒããŒã§ã€ã³ã¿ãŒãããã®é床ã確èªããå¿ èŠããããŸããïŒ
ãã©ãŠã¶ãŠã£ã³ããŠã®å¹ ã調ã¹ãŠãããã䜿çšããŠãªãŒããŒã«é ä¿¡ããç»åã決å®ããã®ãé©åã§ããããããã¬ã¹ãã³ã·ãç»åã®ã¢ã€ãã¢ã®æ ¹åºã«ãããã®ã§ãã ããããå®éã«ã¯ãããã¯ãã®ãããªæ±ºå®ã®çç±ã®ååã«ãããŸããã æ®ãã®ååã¯ã€ã³ã¿ãŒãããæ¥ç¶ã®é床ã§ãã èªè ãããªãé«éã®ã€ã³ã¿ãŒãããæ¥ç¶ã䜿çšããŠããå Žåã倧ããªã€ã©ã¹ãã圌ã«è»¢éããã®ã¯æ£åžžã§ãã èªè ã®ã€ã³ã¿ãŒãããæ¥ç¶ãéåžžã«é ãå ŽåãïŒç»é¢ã®å¹ ã«é¢ä¿ãªãïŒå°ããªç»åãåä¿¡ããå¿ èŠããããŸãã ã¡ãã£ã¢ãã€ã³ã¿ãŒãããã®é床ã«ã€ããŠè³ªåããããšã¯ããã©ãŠã¶èªäœã«ã¯å®è£ ãããŠããŸããã
çŸåšã®2ã€ã®ç»åå¿çæ§ããŒã«ã¯ã Foresight.js
ä»ã®ãµãŒãã¹ã«é Œãããšã¯ã§ããŸããïŒ
Sencha.IOã¯å®å šã«å€éšã®ã¬ã¹ãã³ã·ãç»åãµãŒãã¹ã§ãã ç§ã®ç¥ãéãã圌女ã¯å®ç§ã«åããŠãããä»äºã«å€§ããªæ¯éã¯ãããŸããã§ãããããã¡ãããªã¹ã¯ã¯åžžã«ãããŸãã
ãã¡ããã次ã®ããã«èããããšãã§ããŸãããã¯ãŒã«ãSencha.IOã®ãã¯ããã¯ã¯åªããŠããŸããããµãŒããŒã«äŸåããå¿ èŠãããã®ã¯åä»ã§ã-ç§ã®ãµãŒããŒã§åæ§ã®ãã®ãå®è¡ãããã§ããã æ¬åœã«å¿ èŠãªå Žåã¯ããããªãã¯WURFLããŒã¿ããŒã¹ããããããŒã«ã«ã§äœæ¥ããããã®ãµãŒããŒãµã€ãã¬ã¹ãã³ã·ãã€ã¡ãŒãžããŒã«ããããŸã ã
ããã€ã¹èªèãåŠçããDevice Atlas Cloudãªã©ã®ãµãŒãã¹ããããŸãã ãŸãã圌ãã¯èªåèªèº«ãžã®äŸåãçã¿åºããŸãã ééããªãã圌ãã®ç®æšã¯ãªã³ã©ã€ã³ãç¶æããè¿ éã«ä»äºãããããšã§ãããããªãã®ããžãã¹ã«ã©ã®ããã«ã誰ã«äŸåããããã«ã€ããŠæ éã«èããŠãã ããã
ã¢ã¯ã»ã·ããªãã£æ©èœãåããç¹å¥ãªCMSã¯ãããŸããïŒ
ãããžã§ã¯ããWordPressã«åºã¥ããŠãããšããŸãã ãã ããWordPressã«ã¯ç»åããŠã³ããŒããŒãçµã¿èŸŒãŸããŠããŸãã ã€ã©ã¹ãããµã€ãã«ã¢ããããŒããããšãããã€ãã®å°ããªããŒãžã§ã³ã®ç»åãäœæãããå ŽåããããŸãã ããã¯ã¯ãŒã«ã§åŒ·åã§ãããããªãã¯ãããå©çšããïŒå¿ èŠãšããïŒããšãã§ããŸãã Keir Whitakerã¯ãèšäºã WordPressã®èªåå¿çç»å ãã§ãã®æ©èœã®äœ¿çšã«ã€ããŠèª¬æããŠããŸãã
ãã¡ããããã®ææ³ã¯WordPressã ãã«é©ããŠããããã§ã¯ãããŸããã åãããŒã«ããã¹ãŠã®CMSã«ååšããïŒãŸãã¯ããžã§åºå®ã§ããïŒãšç¢ºä¿¡ããŠããŸãã
æªæ¥ãåŸ ã€ããšã¯ã§ããŸããïŒ
ãæ°ããiPadãïŒã€ãŸãã3çªç®ã®ãå°æ¥ãžã®æ³šæïŒã®å ¬éã¯ããããã®æè¡ããŒã«ã®å€ãã®åºçŸãšãã®è°è«ã«ã€ãªãããŸããã æ°ããiPadã®é«ããã¯ã»ã«å¯åºŠã¯ããã¯ã¿ãŒç»åã倧ããªåçã®è¡šç€ºã«ã¯åªããŠããŸããããµã€ãºã«åãããŠæ¡å€§ããå¿ èŠãããããã«ãŒãããŠèŠããå°ããªã¢ã€ã³ã³ã«ã¯ç¹ã«é©ããŠããŸããã ãã ããé«è§£å床ã®ã¢ã€ã³ã³ãé åžãããšããã¡ã€ã«ãµã€ãºã倧ãããªãããµã€ãã®é床ãäœäžããŸãã ãããã£ãŠãèªè ãå¿ èŠãšããç¶æ³ã§ã®ã¿é ä¿¡ããå¿ èŠããããŸãã
Webæšæºã¯ãã®åé¡ãèªèããŠããŸãã ã°ã«ãŒãå šäœãè°è«ã«å°å¿µããŠããŸãã æéãçµã€ã«ã€ããŠã圌ãã¯ãã®åé¡ã解決ããããšãã§ããŸã-ãããŠãç§ãã¡ã¯æäŸãããè³éã䜿ãå§ããããšãã§ããŸãïŒãããã®è³éã¯çŸåšã®ãã®ãããã¯ããã«åªããŠãããšå€æãããšä»®å®ããŸãïŒã
Nicolas Gallagherãææ¡ããããã«ããããã
ãã¡ããã芧ãã ãã
- Jason Grigsbyã¯ãã¬ã¹ãã³ã·ãã€ã¡ãŒãžã«é¢ãã3ã€ã®ããŒãã§ã壮倧ãªäžé£ã®ããã°æçš¿ãå
¬éããŸãã ãæåã®ããŒãã¯ããã«ãããŸãã
- ã¯ãªã¹ããã¡ãŒã»ã·ã¥ãããã¯ãã¬ã¹ãã³ã·ãç»åã«é¢ãããã¬ãŒã³ããŒã·ã§ã³ã®ã¹ã©ã€ããæçš¿ããŸããã
- ãããã»ããŒãã¹ã¯ãã ã¬ã¹ãã³ã·ãç»åïŒããããã»ãŒã©ã®ããã«æ©èœã ããªã¹ãã«å¿ èŠãªãã®ã¯å¥ãšããŠããå ¬éããŸãã