ZKã®å©ç¹ããã§ã«ç解ããŠãããç¥èãåºãããå Žåã¯ãW3ã®ããã¥ã¡ã³ããåç §ããããšããå§ãããŸãã
ZKã¯ããªãã®ããã«äœãã§ããŸããïŒ
ç°¡åã«èšãã°ããã£ãã·ã¥ã䜿çšãããšããµãŒããŒãããŠãŒã¶ãŒãã©ãŠã¶ãŒãŸã§ã®éäžã®ãªã¢ãŒããã€ã³ãã«WebãªãœãŒã¹ãä¿åã§ããŸãã ãã©ãŠã¶ã¯ãã£ãã·ã¥ãä¿åãããããã¯ã©ã€ã¢ã³ããåããªãœãŒã¹ãåžžã«èŠæ±ããããšã¯ãããŸããã
Webãã©ãã£ãã¯ã®ãã£ãã·ã¥èšå®ã¯ãã¢ã¯ã»ã¹ãããµã€ãã«ãšã£ãŠéèŠã§ãã ãã©ãã£ãã¯ã®æ¯æããeã³ããŒã¹ããã®åå ¥ã®ç²åŸããŸãã¯åªããWebéçºè ãšããŠã®è©å€ãç¶æãããã ãã®å Žåã¯ããã£ãã·ã³ã°ã®ä»çµã¿ãç解ããå¿ èŠããããŸãã
äŒç€Ÿã®ããŽããã¡ãã³ã³ãµã€ãããŸãã¯ãªã¯ãšã¹ãããšã«å€æŽãããªãåºæ¬çãªCSSãã¡ã€ã«ãªã©ã®ãªãœãŒã¹ã®å Žåããªã¯ãšã¹ã¿ãŒããããã®ãã¡ã€ã«ã®ã³ããŒããã°ããä¿æã§ããããã«ããããšãã§ããŸãã ããªãã®èšªåè ãè»ã®åŸéšåº§åžã«ããåäŸã§ãããŸã å°çããŸãããïŒããšãã€ãå°ãã人ãªãããã®èš±å¯ã¯ããããããã20åè¡ããªããã°ãªããªãã®ã§ãç§ã®çããèŠããŠãããŠãã ããããšããçãã«äŒŒãŠããŸãã
ãµãŒããŒãžã®èŠæ±ã®æ°ãæžããããšã«ããããµãŒããŒãåŠçã§ããèŠæ±ã®æ°ãå¢ãããŸãã éåžžãåçãã¹ã¯ãªãããããã³ã¹ã¿ã€ã«ã·ãŒãã¯ããŒã«ãšããŠãã¿ã§ãã£ãã·ã¥ã§ããåçã«äœæãããããŒãžïŒãã©ãŒã©ã ãWebã¢ããªã±ãŒã·ã§ã³ïŒã¯éåžžã¯äŸ¡å€ããããŸããã äž»ã«ããã©ãŒãã³ã¹ãæžå¿µããå Žåã¯ããã¹ãŠã®åçã³ã³ãã³ããAJAXãªãœãŒã¹ã§æå°åããæ®ããæ倧éã«ãã£ãã·ã¥ããå¿ èŠããããŸãã
顧客ããã³CDNåã
åŸæ¥ããã£ãã·ã¥èšå®ã¯ã¯ã©ã€ã¢ã³ãã®ãã©ãŠã¶ã®ã¿ã«é¢é£ããŠãããããå¿ããªãã§ãã ããã ããããä»æ¥ã§ã¯ãã³ã³ãã³ãé ä¿¡ãããã¯ãŒã¯ïŒCDNïŒã®æ¥å¢ã«é¢é£ããŠãWebã®äžéå°ç¹ã§ãã£ãã·ã¥ãã©ã®ããã«æ©èœããããç解ããããšãããéèŠã§ãã
CDNãšã¯äœã§ããïŒ
Wikipediaã®èšäºå šäœãèªãŸãªãããã«ããããã¯ãµãŒããŒãšã¯ã©ã€ã¢ã³ãã®éã«ããïŒè€æ°ã®ïŒãµãŒããŒã§ãã ããããããããŸããŸãªHTTPããããŒã§æå®ããã«ãŒã«ã«åŸã£ãŠã³ã³ãã³ãããã£ãã·ã¥ããŸãã
é©åã«èšå®ãããšãCDNã¯ã³ã³ãã³ããæéãã€æãè¿ããµãŒããŒãä»ããŠã¯ã©ã€ã¢ã³ãã«è»¢éããŸãã ããã«ãCDNã¯ãŠãŒã¶ãŒãšãŠãŒã¶ãŒéã®ãããã¡ãŒãšããŠæ©èœããŸãã ãã£ãã·ã¥ããããªã¯ãšã¹ãïŒCDNããµãŒããŒããã«ããã«åŠçãããªã¯ãšã¹ãïŒã®å²åã«é¢å¿ããããŸãã ãã©ãã£ãã¯ãšã¢ãŒããã¯ãã£ã«å¿ããŠããã®æ°å€ã¯90ïŒ ã«éããå¯èœæ§ããããŸãããå°ããæ°å€ã§ã¯å¹æãããããŸãã å°æ°ã®ãªã¯ãšã¹ãã§ã¯ããããã®ã»ãšãã©ããµãŒããŒã«éä¿¡ãããããšã«æ³šæããå¿ èŠããããŸãããããã£ãŠããã®å²åã¯ããã£ãã·ã¥æéãšãµã€ãã®å šäœçãªè² è·ãšãšãã«ã®ã¿æå³ãæã¡ãŸãã ãã ãã1ã€ã®ãã£ãã·ã¥ã®ã¿ãæ§æãããã£ãã·ã¥ããããŒãæ£ããæ©èœããªãå Žåã¯ãåèšãããã«æªåããå¯èœæ§ããããŸãã
ãµãŒããŒã¯ãç°ãªãå°åã«ååšããäžéãµãŒããŒã«ã³ã³ãã³ããé ä¿¡ããŸãã
ãã£ãã·ã¥ã«å ããŠãCDNã«ã¯çŽ æŽãããå¯äœçšããããŸãããµãŒããŒãçªç¶ã¯ã©ãã·ã¥ããå Žåãå Žåã«ãã£ãŠã¯CDNã¯ãŠãŒã¶ãŒãæ°ä»ããªãããã«ãªã¯ãšã¹ãããããã¡ãªã³ã°ããŸãã
äž»ãªèŠåºã
1.ãã£ãã·ã¥å¶åŸ¡
æãéèŠãªãã®ã éåžžã次ã®ãããªãã©ã¡ãŒã¿ã1è¡ã§èšå®ããŸãã
ãã£ãã·ã¥å¶åŸ¡ïŒprivateãmax-age = 0ãno-cache
ãããã®èšå®ã¯ãã£ãã·ã¥å¿çãã£ã¬ã¯ãã£ããšåŒã°ãã次ã®ãšããã§ãã
ãã©ã€ããŒã| å ¬é
ã³ã³ãã³ããç¹å®ã®ãŠãŒã¶ãŒåããã©ãããå ±åããŸãã ãã®å Žåããã£ãã·ã¥ããå¿ èŠã¯ãããŸããã
ãã£ãã·ã¥ãªã
ãã£ã¬ã¯ãã£ãèªäœã¯ããã®ãªã¯ãšã¹ãã¯æ¯åæ°ãã«è¡ããªããã°ãªããªãããšã瀺ããŠããŸãã 以äžã§èª¬æããetagããããŒãäžè¬çã«äœ¿çšãããŸãã ãã®ãã£ã¬ã¯ãã£ãã®åŸã«ãã£ãŒã«ãã«ååãä»ãããšã楜ãã¿ãå§ãŸããŸãã ãã®åŸããã£ãã·ã¥ãµãŒããŒã¯åçããã£ãã·ã¥ã§ããããšãç解ããŸãããæå®ãããã£ãŒã«ããåé€ããå¿ èŠããããŸãã ããã¯ãããšãã°ãCookieã®é©åãªæäœã«åœ¹ç«ã¡ãŸãã ãã ããäžéšã®å€ãããã°ã©ã ã§ã¯ããã®ããªãã¯ã®äœ¿çšæ¹æ³ãããããŸããã
åºãªã
ãã®å¿çãä¿åããå¿ èŠããªãããšãå ±åããŸãã é©ãã¹ãããšã«ãäºå®ã ãã£ãã·ã¥ãã«ãŒã«ã«åŸã£ãŠæ©èœããå Žåããªã¯ãšã¹ãã®ã©ã®éšåãä¿åãããªãããã«ããŸãã ããã¯ãæ©å¯æ å ±ãä¿è·ããããã«å¿ èŠã§ãã
æ倧幎霢
éåžžããªãœãŒã¹ã®ã©ã€ãã¿ã€ã ã¯æå¹æéã§æå®ãããŸãããããå ·äœçã«ããå¿ èŠãããå Žåã¯ãmax-ageãç§åäœã§æå®ã§ããŸãã ãŸãããã®ãã£ã¬ã¯ãã£ãã«ã¯æå¹æéãããå©ç¹ããããŸãã
s-maxage
ãã ããåã®ãã®ãšå°ã䌌ãŠããŸãããsã¯å ±æãã£ãã·ã¥ãæå³ããCDNã«å¿ èŠã§ãã ãã®ãã£ã¬ã¯ãã£ãã¯max-ageãããåªå ãããCDNãµãŒããŒã«ãªããšæéåãã«ãªããŸãã
åæ€èšŒããå¿ èŠããããŸã
圌ã¯ãåãªã¯ãšã¹ããæ°ãã«è¡ãå¿ èŠããããã©ã®ãããªç¶æ³ã§ããŠãŒã¶ãŒããã£ãã·ã¥ãããã³ã³ãã³ããæäŸããã¹ãã§ã¯ãªããšèšããŸãã ãã£ãã·ã³ã°ãæå¹ã«ããä»ã®ãã¹ãŠã®ãã£ã¬ã¯ãã£ããããåªããŠããŸãã äž»ã«ããã€ãã®ç¹å¥ãªãããã³ã«ïŒééãªã©ïŒã§äœ¿çšãããŸãã
å€æãªã
äžéšã®ãããã·ã¯ãã³ã³ãã³ããå§çž®ããã³å€æããŠäœæ¥ãé«éåã§ããŸãã ãã®ãã£ã¬ã¯ãã£ãã¯ãã®åäœãçŠæ¢ããŸãã
ãããã·ã®åæ€èšŒ
must-revalidateãšã»ãŒåãã§ãããäžéCDNãµãŒããŒçšã§ãã ãªã圌女ã¯s-mustrevalidateãšåŒã°ããªãã£ãã®ã§ããïŒ åœŒãç¥ã£ãŠãã人ã ãã€ã³ãã¯ãã³ã³ãã³ããæŽæ°ããããã©ããã確èªããããã«ãæ°ãããŠãŒã¶ãŒããšã«1åã ãå¿ èŠãªããšã§ãã
2.æå¹æé
åœåãããã¯ãªãœãŒã¹ã®æå¹æéã決å®ããæšæºçãªæ¹æ³ã§ããã ä»æ¥ã§ã¯ãmax-ageãšs-maxageãåªå ãããŸãããäžäœäºææ§ã®ããã«ãã®ããããŒãèšå®ããããšã¯åžžã«åœ¹ç«ã¡ãŸãã
1幎以äžå ã®æ¥ä»ãèšå®ãããšãããããŒã®ä»æ§ã«éåããŸãã
3. etag
ãšã³ãã£ãã£ã¿ã°ã®é åèªã ããã¯ãèŠæ±ããããªãœãŒã¹ã®äžæã®èå¥åã§ããéåžžããã®ã³ã³ãã³ãã®ããã·ã¥ããŸãã¯æŽæ°ãããæéã®ããã·ã¥ã§ãã äžè¬ã«ãã¯ã©ã€ã¢ã³ãã®CDNããã®ãªã¯ãšã¹ãæ¹æ³ã¯ããç§ã®ãªãœãŒã¹ãšã¯ç°ãªãetagãããå ŽåããªãœãŒã¹XãæäŸããŸããã
4.å€åãã
éåžžã«åŒ·åãªãã®ã IEã¯éå»ã«èª€ã£ãŠåŠçããŠããŸããããä»ã§ãæ£ããåŠçããŠããŸããã ããæç¹ã§ã圌ãšäžç·ã®Chromeã§ãããã°ããããŸããã åºæ¬çã«ãããããŒã¯ããã£ãã·ã¥å ã®ã³ã³ãã³ããæå¹ãã©ãããå€æããããã«äœ¿çšã§ããããããŒããã£ãã·ã³ã°ã·ã¹ãã ã«äŒããŸãã ãã£ãã·ã¥ãããŒå€ããŒã¿ã¹ãã¢ãšèŠãªãå ŽåãVaryã䜿çšãããšããããã®å€ãããŒã«è¿œå ãããŸãã
å€ãã®å ŽåãAccept-Encodingã®ãããªããããŒãèŠã€ããããšãã§ããŸããããã«ãããgzipã§å§çž®ããããªãœãŒã¹ãã¯ã©ã€ã¢ã³ãã«ç¢ºå®ã«åãå ¥ããããŸãã ããã¯å€ãã®ãã©ãã£ãã¯ãç¯çŽããŸãã ãŸããèšå®
å€åããïŒãŠãŒã¶ãŒãšãŒãžã§ã³ã
User-Agentã«å¿ããŠç°ãªãHTML / CSSãã¬ã³ããªã³ã°ãããšããµã€ãã®SEOããã䜿ãããããªããŸãã Googleã¯ãã®å°ããªããšã«æ°ä»ããGooglebotã¯ã¢ãã€ã«ã³ã³ãã³ããåŠçããŸãã
5.ãã©ã°ã
å€ãã®ããšãå®è¡ã§ããããªãå€ããã£ã¬ã¯ãã£ãã§ãããããæ°ãããã£ã¬ã¯ãã£ãã䜿çšããŠæ¢ã«åŠçãããŠããŸãã ç§ãã¡ã¯ãã©ãŒã ã«æãèå³ããããŸã
ãã©ã°ãïŒno-cache
çŸä»£ã®é¡§å®¢ã§ã¯äœãå€ãã
ãã£ãã·ã¥å¶åŸ¡ïŒãã£ãã·ã¥ãªã
èŠå
ãã¹ãŠã®CDNãŸãã¯ã¯ã©ã€ã¢ã³ãããã°ã©ã ãä»æ§ã«åŸã£ãŠåäœããããã§ã¯ãããŸããã Webéçºè ã§ããã°ããã®åé¡ã«ç²ŸéããŠããŸãã ãããã£ãŠããµãŒãã¹ãéå§ããåã«ããã¹ãŠããã¹ãããŠããã¹ãŠãæ£åžžã«æ©èœããããšã確èªããå¿ èŠããããŸãã
ããã«ãäžéšã®èŠåºããéè€ãŸãã¯éè€ããŠããå ŽåããããŸãã ããã¯ãããŸããŸãªæ¹æ³ã®ããããªéãããŸãã¯WebãHTTP / 1.0ããHTTP / 1.1ãããã³ã«ã«ç§»è¡ããããã§ãããã®ãããã³ã«ã§ã¯ããã£ãã·ã¥ããã詳现ã«èª¬æãããŠããŸãã
1.å§çž®
蚱容å¯èœãªå§çž®ãšããŠgzipãžã®èŠæ±ãåãåã£ãCDNãããã€ããŒã¯ããµãŒããŒããå§çž®ã³ã³ãã³ããèŠæ±ãããããªãœãŒã¹ã®å§çž®ããŒãžã§ã³ãã¯ã©ã€ã¢ã³ãã«æäŸããå¿ èŠããããŸãã ææ°ã®CDNã¯ããªãœãŒã¹å§çž®ãç¬ç«ããŠå®è¡ã§ããŸãã
CDNãµãŒããŒã®ããã©ãŒãã³ã¹ããã¹ãããå ŽåããªãœãŒã¹ã®å§çž®ããŒãžã§ã³ãšéå§çž®ããŒãžã§ã³ã®äž¡æ¹ããã§ãã¯ããããã«æ§æãããŠãããã®ãããããšãèæ ®ããå¿ èŠããããŸãã ãã®ãã§ãã¯ã«ãããå¿çæéããããã«é·ããªããŸãã
2. SSL
CDNã¯äžéè ã§ãã HTTPSãã©ãã£ãã¯ã®æŽçãšããµãŒããŒãžã®éä¿¡æ¹æ³ã«ã€ããŠèããå¿ èŠããããŸãã å€ãã®CDNã¯èŠæ±ãsomesite.com/assetããsomesite.com/assetã«ãªãã€ã¬ã¯ãããŸãããããã£ãŠããµãŒããŒã®ããžãã¯ããããã³ã«ã«äŸåããŠããå Žåã¯ãããžãã¯ãå€æŽããããCDNã«HTTPSã«ãªãã€ã¬ã¯ãããããã«äŸé ŒããŸãã
åçã³ã³ãã³ãã¯ã©ãã§ããïŒ
éåžžããã®å Žåãcache-controlïŒno-cacheãèšå®ããŠãCDNããã£ãã·ã¥ããªãããã«ããå¿ èŠããããŸãã 圌ã®ä»äºãå°ãã¹ããŒãã¢ããããæ¹æ³ã«èå³ããããªããèªã¿ç¶ããŠãã ããã
å žåçãªåçã³ã³ãã³ã
HTTP/1.1 200 OK Server: Apache X-Rack-Cache: miss ETag: "e6811cdbcedf972c5e8105a89f637d39-gzip" Status: 200 Content-Type: text/html; charset=utf-8 Expires: Mon, 29 Apr 2013 21:44:55 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache Date: Mon, 29 Apr 2013 21:44:55 GMT
ã»ãšãã©ã®åçã³ã³ãã³ãã¯ããã»ã©äžè²«ããŠããŸããã ããšãã°ãã¢ã¯ãã£ããªãŠãŒã¶ãŒã®ãªã¹ãã®æå¹æéã¯10ã20ç§ã§ãã ãã£ãŒãããŒãžã¯ããããæ°åé衚瀺ãããŸãã ãã£ãŒãã¯ãç¹ã«etagã䜿çšããŠãã°ãããã£ãã·ã¥ã§ããŸãã ãµã€ãã®è² è·ãé«ãå Žåããã°ããã®éãªãœãŒã¹ã®äžéšããã£ãã·ã¥ããŠã¿ã䟡å€ããããŸãã
ãã£ãã·ã¥æéåæ
ããã§ã¯ããªãœãŒã¹ãèšå®ããã®ã«æé©ãªææã¯äœã§ããïŒ ãã©ãã£ãã¯ã®éããªãœãŒã¹ã®ãµã€ãºããã£ãã·ã¥ã®ãµã€ãºã«äŸåããŸãã
ããã«ããã£ãã·ã³ã°ã®äž»ãªæ¬ ç¹ãã€ãŸããªãœãŒââã¹ã®å¶åŸ¡ã®äœäžãèæ ®ããå¿ èŠããããŸãã ãªãœãŒã¹ãããã«æŽæ°ããå¿ èŠãããå Žåã1幎åã«åœŒã«å°ãããšåé¡ãçºçããŸãã ç¹ã«ããã®æéãCDNïŒs-maxageïŒã ãã§ãªãããŠãŒã¶ãŒïŒmax-ageïŒã«ãèšå®ããå Žåã
ãã£ãã·ã¥ã®æé·æéã¯1幎ãã€ãŸã31536000ã§ããããããããã¯æªãèãã§ãã é¡ã«ã¿ãã¥ãŒãå ¥ãããããªãã®ã§ãã ãµãŒããŒãããªãœãŒã¹ãå€æŽããããã©ããã«é¢ããCDNããã®å°ãªããšãæ¯æ¥ã®èŠæ±ã«èããããªãå Žåã¯ããµãŒããŒãå€æŽããæãæ¥ãŸããã
éçã³ã³ãã³ãããããŒ
HTTP/1.1 200 OK Cache-Control: no-transform,public,max-age=300,s-maxage=900 Content-Type: text/html; charset=UTF-8 Date: Mon, 29 Apr 2013 16:38:15 GMT ETag: "bbea5db7e1785119a7f94fdd504c546e" Last-Modified: Sat, 27 Apr 2013 00:44:54 GMT Server: AmazonS3 Vary: Accept-Encoding X-Cache: HIT
S3ã䜿çšããéçã³ã³ãã³ãã®ãã£ãã·ã¥èšå®ã®äŸã ãã£ãã·ã¥ã«ã¯ããŠãŒã¶ãŒããã°ã©ã ã®å Žåã¯300ç§-ãªãœãŒã¹ã900ç§éä¿åããããšããå§ãããŸãã æåŸã®èŠåºãã¯ãã©ã®CDNããªã¯ãšã¹ããåŠçãããã瀺ããŠããŸãã
ã1幎éãªãœãŒã¹ããã£ãã·ã¥ããªããã³ãã³ãã®äŸå€ããŸãã¯é·ããã£ãã·ã¥ã®åé¡ãåé¿ããããã®1ã€ã®ããã¯ã æ°ããããŒãžã§ã³ããªãªãŒã¹ãããã³ã«ãªãœãŒã¹ã®ååãå€æŽã§ããŸãã å¢å ããããŒãžã§ã³çªå·ãäžæçãªã©ãã«ãããã·ã¥ãååã«è¿œå ã§ããŸãã
次ã®è¡šã«ãã£ãã·ã¥æ倱ã瀺ããŸãã ãªãœãŒã¹ã1åéã«500件ã®ãªã¯ãšã¹ããåä¿¡ãããšä»®å®ãããšãããŸããŸãªãªãœãŒã¹ä¿åæéãªãã·ã§ã³ã«ã€ããŠæ¬¡ã®å²åã®ãã£ãã·ã¥ãªã¯ãšã¹ããååŸãããŸãã
ãã£ãã·ã¥æéïŒåïŒ | ãã£ãã·ã¥ãªã¯ãšã¹ãã®å²å | 1æéãããã®å ã®ãªã¯ãšã¹ã |
1 | 99.8ïŒ | 60 |
5 | 99.96ïŒ | 12 |
20 | 99.99ïŒ | 3 |
60 | 99.997ïŒ | 1 |
86400 | 99.9998ïŒ | <1 |
ãã£ãã·ã¥ãªã¯ãšã¹ãã®äœããŒã»ã³ããããªãã«åã£ãŠããŸããïŒ éåžžããªãœãŒã¹ã®æå¹æéã¯60ç§ãã60åã§ãã ç䌌åçã³ã³ãã³ãã®å Žåãæ倧60ç§ã®ç¯å²ã§ãã£ãã·ã¥æéãèšå®ã§ããŸãã
CDNãã§ãã¯
ããããŒãæåŸ ã©ããã«CDNãééããããšã確èªããŸãã éåžžãCDNã¯ãã®ãªãœãŒã¹ã®è©³çŽ°ã瀺ãäœããã®XããããŒãæ¿å ¥ããŸãã ããã«ãç§ã«ãšã£ãŠéåžžã«åœ¹ç«ã€ãšæãããããã€ãã®ããŒã«ããããŸãã
1. Webã€ã³ã¹ãã¯ã¿ãŒ
æãç°¡åãªæ¹æ³ã¯ãChromeã§ããŒãžãå³ã¯ãªãã¯ãã[èŠçŽ ã®æ€æ»]ãéžæãã[ãããã¯ãŒã¯]ã¿ãã«ç§»åããŠãHTMLãªãœãŒã¹ãã¯ãªãã¯ããããšã§ãã ãããããã©ã«ãã§éžæãããŠããªãå Žåã¯ã[ããããŒ]ã¿ããéžæããŠãã¹ãŠã®ããããŒã衚瀺ããŸãã Chromeã«ã¯ããŠãŒã¶ãŒãšãŒãžã§ã³ããèšå®ããããŒã«ã«ãã£ãã·ã¥ã䜿çšããªãæ©èœããããŸãã
2. ãã£ãŒã«ãºãããã·
ãã®ãããªãããã·ãä»ããŠããã©ãã£ãã¯ããªãã€ã¬ã¯ãããDNSã¯ãšãªãæäœããããããŒãèšé²ããããã©ãŒãã³ã¹çµ±èšãèŠãããšãã§ããŸã-ãããã¯ãã¹ãŠããããããã·ã³ãã«ãªGUIã§è¡ããŸãã
3.cURL
ã³ãã³ãã©ã€ã³ããèŠæ±ãè¡ããå¿çããããŒã衚瀺ããŸãã 䟿å©ãªããŒïŒ-AãŠãŒã¶ãŒãŠã£ãžã§ããã®è¡šç€ºã-b-Cookieã-F-ãã©ãŒã ããŒã¿ã-H-ããããŒã®å²ãåœãŠã-I-ãªã¯ãšã¹ãããããŒã®ã¿ã
4. hurl.it
倧ãŸãã«èšã£ãŠãããã¯æ確ãªã€ã³ã¿ãŒãã§ãŒã¹ãæã€cURLã§ãã ããããŒãèšå®ããå¿çããããŒãšå¿çæ¬æã衚瀺ã§ããŸãã
5. Pythonãšãªã¯ãšã¹ã
Requestsã¯ãWebãªã¯ãšã¹ãçšã®Pythonã©ã€ãã©ãªã§ãã ãã®å©ããåããŠããµã€ãã®èªåãã¹ããäœæã§ããŸãã
ããŒãžã³ããŒã
ããã§ã¬ã€ãå šäœãèªãã ã®ã§ãããã€ãã®æ³šæäºé ããããŸãã
ApacheãNginxãªã©ãã»ãšãã©ã®WebãµãŒããŒãã»ãšãã©ã®äœæ¥ãè¡ããŸãã cache-controlããããŒãæäœããã ãã§ãã ãã©ãŠã¶ã¯éåžžãã³ã³ãã³ãã®åŒ·åãªãã£ãã·ã¥çšã«æ§æãããŠãããããå€ãã®å Žåãä»ã®æ¹æ³ãããéå°ãªãã£ãã·ã¥ã«å¯ŸåŠããå¿ èŠããããŸãã éåžžã300ç§ãªã©ã®ããçšåºŠã®æéãã£ãã·ã¥ããã/ staticããªã©ã®ãã¹ãæå®ããŸãã 次ã«ããcache-controlïŒno-cacheããšããèŠåºãã§ã«ãŒããã¹ã/ããæå®ããå¿ èŠããããŸãããåçã³ã³ãã³ãã®ãŠãŒã¶ãŒããµãŒããŒã«çŽæ¥ãªãã€ã¬ã¯ãããã/ staticãã«ãããã®ã®ã¿ãCDNã«æ®ãããšããå§ãããŸãã
éåžžãCDNã«ã¯ãããããŒã«é¢ä¿ãªããå¿ èŠã«å¿ããŠãã£ãã·ã³ã°ã«ãŒã«ãšãã£ãã·ã¥ã解é€ããæ©èœããããŸãã ãŸãããããã³ã«ãéåžžã«èªç±ã«æ±ãããšãå€ããããCDNãµãŒããŒãæäŸãããã®ããã¹ããããµãŒããŒã®ããããŒãšæ¯èŒããããšãéåžžã«éèŠã§ãã
ãµã€ããé«éåããããã®è¿œå è³æã«ã€ããŠã¯ã ã¢ãã€ã«Webããã©ãŒãã³ã¹ã®ããã¥ã¡ã³ããåç §ããããšããå§ãããŸãã