mod_cahceã§ç»åããã£ãã·ã¥ãã¦ãå ´åã¯ç»åã«"Vary: User-Agent"ã¤ããªãããã«ãã¾ãããã¨ãã話
ã¯ã
å¤é¨ã¹ãã¬ã¼ã¸ã§ç»åã管çãã¦ã¦ã表示æã«æ¯åãã®å¤é¨ã¹ãã¬ã¼ã¸ã«åãã«ãããªãã¦æ¸ãããã«ããã³ãå´ã§ãã£ãã·ã¥ãã¨ãã¨ããã®ã¯ãããã話(?)ã ã¨æãã¾ãã
ä¾ãã°apacheã®è¨å®ã§
RewriteEngine on RewriteRule ^/images/(.+)$ http://external.storage.dameninngenn.com/images/$1 [P,L] <IfModule mod_cache.c> CacheRoot /dev/shm/mod_cache CacheEnable disk /images # ... </IfModule>
ã¿ããã«ãã¦ãã㨠/images/hoge.jpg ã«ãªã¯ã¨ã¹ãããå ´åãã£ãã·ã¥ããã¦ãªããã°å¤é¨ã¹ãã¬ã¼ã¸ã«ã¨ãã«ãã£ã¦è¡¨ç¤ºãã¦ããã£ãã·ã¥ããã¦ããã°ãããè¿ãã¨ãã風ã«ãªãã¾ãã
ãã®ã¾ã¾ã ã¨ç¹ã«åé¡ã¯ãªãã®ã§ãããããã«"Vary: User-Agent"ãå
¥ã£ã¦ããã¨User-Agentæ¯ã«ãã£ãã·ã¥ãä¿åããã¦ãã¾ããã£ãã·ã¥ãµã¤ãºãè¨ãä¸ããã¾ãã
ä»åã®ã±ã¼ã¹ã ã¨diskãã£ãã·ã¥ã ãã©/dev/shmã使ã£ã¦ãã®ã§ã¢ãªã¢ãªã¡ã¢ãªä½¿ã£ã¦ãããswapãã¾ãã£ã¦äººéãæ»ã¬ã
ç»åã«ã¯Varyãããã¤ããªãããã«ãã¨ãã§ããã¼ã£ã¦æãããããã¾ããããçµæ§ã³ããã¨ãã§ãã£ããããã£ããããããã§ãã
ä¾ãã°deflateã®è¨å®é¨åã§å ¨é¨ã«Varyã¤ãã¦ãåé¡ãªãå ´åã ã¨
Header append Vary User-Agent
ã¨ãã¦ããã
SetEnvIfNoCase Request_URI \ \.(?:gif|jpe?g|png)$ no-gzip dont-vary Header append Vary User-Agent env=!dont-vary
ããããã¨ãã
http://httpd.apache.org/docs/2.2/mod/mod_deflate.html
ä½è«
ãªããã®ããã»ã¹ãswapé å使ã£ã¦ãå ´åã¨ãã ã¨å²ãã¨ç°¡åã«ã©ã®ããã»ã¹ã使ã£ã¦ããã£ã¦ããã®ã¯ããããã©ãããã»ã¹ä»¥å¤ã®ä½ããswap使ã£ã¦ãæã«ã©ãã¤ãswap使ã£ã¦ãã®ããã©ã調ã¹ãããããå ¨ç¶ããããªãã£ãã
swap使ã£ã¦ãã®ã¯ã³ã¤ãã§ããã¼ã£ã¦ããåããæ¹æ³ãããã°ç¥ããããã
ããã»ã¹ä»¥å¤ã ã¨ã ãããç®å¦ãã¤ããããããããªãããªï¼ãããããããããªã¼ãããã®ã
ããããããããã¸ãã®ç¥èã貧弱ãªã®ã§è²ã
身ã«ä»ããããã©ãå®éã«åé¡ãèµ·ãã¦èªåã§ãã©ãã«ã·ã¥ã¼ããã¦å§ãã¦èº«ã«ã¤ãããããããã ã¨ãæã£ã¦ãã®ã§é£ããã