Apache HTTP Server Version 2.3
¼³¸í: | URI¸¦ Å°·Î »ç¿ëÇÏ¿© ³»¿ëÀ» ij½¬ÇÑ´Ù. |
---|---|
»óÅÂ: | Experimental |
¸ðµâ¸í: | cache_module |
¼Ò½ºÆÄÀÏ: | mod_cache.c |
mod_cache
´Â °°Àº ÄÄÇ»ÅÍ¿¡ ÀÖ´Â ³»¿ëÀ̳ª
ÇÁ·Ï½ÃµÈ ³»¿ëÀ» ij½¬ÇÒ ¼ö ÀÖ´Â RFC 2616
ȣȯ HTTP ³»¿ëij½¬¸¦ ±¸ÇöÇÑ´Ù. mod_cache
¸¦
»ç¿ëÇÏ·Á¸é ÀúÀå°ü¸®¸ðµâ(storage management module)ÀÌ ÇÊ¿äÇÏ´Ù.
±âº» ¾ÆÆÄÄ¡ ¹èÆ÷º»¿¡´Â µÎ°¡Áö ÀúÀå°ü¸®¸ðµâÀÌ ÀÖ´Ù:
mod_disk_cache
mod_mem_cache
mod_mem_cache
´Â ÆÄÀϱâ¼úÀÚ¸¦ ij½¬Çϰųª
Èü(heap) °ø°£¿¡ °´Ã¼¸¦ ij½¬ÇÏ´Â µÎ°¡Áö ¹æ½ÄÁß ÇÑ°¡Áö ¹æ¹ýÀ¸·Î
µ¿ÀÛÇϵµ·Ï ¼³Á¤ÇÒ ¼ö ÀÖ´Ù. mod_mem_cache
´Â
ÀÚ½ÅÀÌ »ý¼ºÇÑ ³»¿ëÀ» ij½¬Çϰųª, (¿ªÇÁ·Ï½Ã(reverse proxy)·Î
¾Ë·ÁÁø) ProxyPass
¸¦
»ç¿ëÇÏ¿© mod_proxy
¸¦ À§ÇØ µÞ´Ü ¼¹ö³»¿ëÀ»
ij½¬ÇÒ ¼ö ÀÖ´Ù.³»¿ëÀ» URI¸¦ Åä´ë·Î ¸¸µç Å°·Î ij½¬¿¡ ÀúÀåÇÏ°í °¡Á®¿Â´Ù. Á¢±Ùº¸È£°¡ µÈ ³»¿ëÀº ij½¬ÇÏÁö¾Ê´Â´Ù.
°ü·ÃµÈ ¸ðµâ | °ü·ÃµÈ Áö½Ã¾î |
---|---|
#
# ¿¹Á¦ ij½¬ ¼³Á¤
#
LoadModule cache_module modules/mod_cache.so
<IfModule mod_cache.c>
#LoadModule disk_cache_module modules/mod_disk_cache.so
<IfModule mod_disk_cache.c>
CacheRoot c:/cacheroot
CacheSize 256
CacheEnable disk /
CacheDirLevels 5
CacheDirLength 3
</IfModule>
LoadModule mem_cache_module modules/mod_mem_cache.so
<IfModule mod_mem_cache.c>
CacheEnable mem /
MCacheSize 4096
MCacheMaxObjectCount 100
MCacheMinObjectSize 1
MCacheMaxObjectSize 2048
</IfModule>
</IfModule>
¼³¸í: | ¸¸±â½Ã°£À» ÁöÁ¤ÇÏÁö¾ÊÀº ¹®¼¸¦ ij½¬ÇÒ ±âº» ±â°£. |
---|---|
¹®¹ý: | CacheDefaultExpire seconds |
±âº»°ª: | CacheDefaultExpire 3600 (one hour) |
»ç¿ëÀå¼Ò: | ÁÖ¼¹ö¼³Á¤, °¡»óÈ£½ºÆ® |
»óÅÂ: | Experimental |
¸ðµâ: | mod_cache |
CacheDefaultExpire
Áö½Ã¾î´Â ¹®¼ÀÇ
¸¸±â½Ã°£°ú ÃÖ±Ù¼öÁ¤½Ã°£ÀÌ ¾ø´Â °æ¿ì ¹®¼¸¦ ij½¬ÇÒ ÃÊ´ÜÀ§
±âº» ½Ã°£À» ÁöÁ¤ÇÑ´Ù. CacheMaxExpire
·Î
ÁöÁ¤ÇÑ °ªÀÌ ÀÌ ¼³Á¤À» ¹«½ÃÇÏÁö ¾Ê´Â´Ù.
CacheDefaultExpire 86400
¼³¸í: | ƯÁ¤ URLÀ» ij½¬ÇÏÁö ¾Ê´Â´Ù |
---|---|
¹®¹ý: | CacheDisable url-string |
»ç¿ëÀå¼Ò: | ÁÖ¼¹ö¼³Á¤, °¡»óÈ£½ºÆ® |
»óÅÂ: | Experimental |
¸ðµâ: | mod_cache |
CacheDisable
Áö½Ã¾î¸¦ »ç¿ëÇϸé
mod_cache
°¡ url-string ÀÌÇÏÀÇ
urlµéÀ» ij½¬ÇÏÁö ¾Ê´Â´Ù.
CacheDisable /local_files
¼³¸í: | ÁöÁ¤ÇÑ ÀúÀå°ü¸®ÀÚ¸¦ »ç¿ëÇÏ¿© ÁöÁ¤ÇÑ URLÀ» ij½¬ÇÑ´Ù |
---|---|
¹®¹ý: | CacheEnable cache_type url-string |
»ç¿ëÀå¼Ò: | ÁÖ¼¹ö¼³Á¤, °¡»óÈ£½ºÆ® |
»óÅÂ: | Experimental |
¸ðµâ: | mod_cache |
CacheEnable
Áö½Ã¾î¸¦ »ç¿ëÇϸé
mod_cache
°¡ url-string ÀÌÇÏ
urlµéÀ» ij½¬ÇÑ´Ù. ij½¬ ÀúÀå°ü¸®ÀÚ´Â cache_type
¾Æ±Ô¸ÕÆ®·Î ÁöÁ¤ÇÑ´Ù. cache_type mem
˼
mod_mem_cache
°¡ ±¸ÇöÇÏ´Â ¸Þ¸ð¸®±â¹Ý
ÀúÀå°ü¸®ÀÚ¸¦ »ç¿ëÇÑ´Ù. cache_type disk
´Â
mod_disk_cache
°¡ ±¸ÇöÇÏ´Â µð½ºÅ©±â¹Ý
ÀúÀå°ü¸®ÀÚ¸¦ »ç¿ëÇÑ´Ù. cache_type fd
´Â
mod_mem_cache
°¡ ±¸ÇöÇÏ´Â ÆÄÀϱâ¼úÀÚ Ä³½¬¸¦
»ç¿ëÇÑ´Ù.
(¾Æ·¡ ¿¹¿Í °°ÀÌ) URL °ø°£ÀÌ ´Ù¸¥
CacheEnable
Áö½Ã¾î¿Í °ãÄ¡¸é ½ÇÁ¦·Î
ÇÑ ÀúÀå°ü¸®ÀÚ°¡ ¿äûÀ» ó¸®ÇÒ¶§±îÁö µÎ ÀúÀå°ü¸®ÀÚ¸¦ ¸ðµÎ
½ÇÇàÇÑ´Ù. ¼³Á¤ÆÄÀÏ¿¡¼ CacheEnable
Áö½Ã¾îÀÇ ¼ø¼´ë·Î ÀúÀå°ü¸®ÀÚ°¡ ½ÇÇàµÈ´Ù.
CacheEnable mem /manual
CacheEnable fd /images
CacheEnable disk /
¼³¸í: | Ŭ¶óÀ̾ðÆ®°¡ ij½¬ÇÏÁö¾Ê´Â ³»¿ëÀ» ¿äûÇÔÀ» ¹«½ÃÇÑ´Ù. |
---|---|
¹®¹ý: | CacheIgnoreCacheControl On|Off |
±âº»°ª: | CacheIgnoreCacheControl Off |
»ç¿ëÀå¼Ò: | ÁÖ¼¹ö¼³Á¤, °¡»óÈ£½ºÆ® |
»óÅÂ: | Experimental |
¸ðµâ: | mod_cache |
º¸Åë no-cache³ª no-store Çì´õ°ªÀ» °¡Áø ¹®¼´Â ij½¬¿¡
ÀúÀåÇÏÁö¾Ê´Â´Ù. CacheIgnoreCacheControl
Áö½Ã¾î´Â ÀÌ·± ÇൿÀ» º¯°æÇÑ´Ù.
CacheIgnoreCacheControl
OnÀ» »ç¿ëÇϸé
¼¹ö´Â ¹®¼¿¡ no-cache³ª no-store Çì´õ°ªÀÌ À־ ¹®¼¸¦
ij½¬ÇÑ´Ù. ÀÎÁõÀÌ ÇÊ¿äÇÑ ¹®¼´Â Àý´ë·Î ij½¬ÇÏÁö
¾Ê´Â´Ù.
CacheIgnoreCacheControl On
¼³¸í: | ij½¬¿¡ ÁöÁ¤ÇÑ HTTP Çì´õ(µé)¸¦ ÀúÀåÇÏÁö ¾Ê´Â´Ù |
---|---|
¹®¹ý: | CacheIgnoreHeaders header-string [header-string] ... |
±âº»°ª: | CacheIgnoreHeaders None |
»ç¿ëÀå¼Ò: | ÁÖ¼¹ö¼³Á¤, °¡»óÈ£½ºÆ® |
»óÅÂ: | Experimental |
¸ðµâ: | mod_cache |
RFC 2616¿¡ µû¸£¸é È©°£(hop-by-hop) HTTP Çì´õ´Â ij½¬¿¡
ÀúÀåÇÏÁö ¾Ê´Â´Ù. È©°£ HTTP Çì´õ¿¡´Â ´ÙÀ½°ú °°Àº °ÍÀÌ ÀÖÀ¸¸ç,
CacheIgnoreHeaders
¼³Á¤°ú °ü°è¾øÀÌ
¾î¶² °æ¿ì¿¡µµ ij½¬¿¡ ÀúÀåµÇÁö ¾Ê´Â´Ù.
Connection
Keep-Alive
Proxy-Authenticate
Proxy-Authorization
TE
Trailers
Transfer-Encoding
Upgrade
CacheIgnoreHeaders
´Â ij½¬¿¡ ÀúÀåÇϸé
¾ÈµÇ´Â HTTP Çì´õ¸¦ Ãß°¡·Î ÁöÁ¤ÇÑ´Ù. ¿¹¸¦ µé¾î, ÄíÅ°(cookie)¸¦
ij½¬¿¡ ÀúÀåÇÏ¸é ¾ÈµÇ´Â °æ¿ì°¡ ÀÖ´Ù.
CacheIgnoreHeaders
´Â ij½¬¿¡ ÀúÀåÇÏÁö
¾ÊÀ» HTTP Çì´õµéÀ» °ø¹éÀ¸·Î ±¸ºÐÇÑ ¸ñ·ÏÀ» ¹Þ´Â´Ù. (RFC 2616¿¡
µû¶ó) ij½¬¿¡ È©°£ Çì´õ¸¸ ÀúÀåÇÏÁö ¾ÊÀ¸·Á¸é,
CacheIgnoreHeaders
¸¦
None
À¸·Î ¼³Á¤ÇÑ´Ù.
CacheIgnoreHeaders Set-Cookie
CacheIgnoreHeaders None
CacheIgnoreHeaders
¼³Á¤À» »ç¿ëÇÏ¿©
Expires
°°ÀÌ Ä³½¬ °ü¸®¿¡ ÇÊ¿äÇÑ Çì´õ¸¦ ÀúÀåÇÏÁö
¾ÊÀ¸¸é, mod_cache´Â ºñÁ¤»óÀûÀ¸·Î µ¿ÀÛÇÑ´Ù.
¼³¸í: | ÀÀ´ä¿¡ Last Modified Çì´õ°¡ ¾ø´Ù´Â »ç½ÇÀ» ¹«½ÃÇÑ´Ù. |
---|---|
¹®¹ý: | CacheIgnoreNoLastMod On|Off |
±âº»°ª: | CacheIgnoreNoLastMod Off |
»ç¿ëÀå¼Ò: | ÁÖ¼¹ö¼³Á¤, °¡»óÈ£½ºÆ® |
»óÅÂ: | Experimental |
¸ðµâ: | mod_cache |
º¸Åë ÃÖ±Ù¼öÁ¤ÀÏÀÌ ¾ø´Â ¹®¼´Â ij½¬ÇÏÁö ¾Ê´Â´Ù. ¾î¶² °æ¿ì
ÃÖ±Ù¼öÁ¤ÀÏÀ» (¿¹¸¦ µé¾î mod_include
ó¸®Áß¿¡)
»©°Å³ª óÀ½ºÎÅÍ ¾ø¾úÀ» ¼ö°¡ ÀÖ´Ù.
CacheIgnoreNoLastMod
Áö½Ã¾î´Â ÃÖ±Ù¼öÁ¤ÀÏÀÌ
¾ø´Â ¹®¼µµ ¹Ýµå½Ã ij½¬Çϵµ·Ï ¸¸µç´Ù. ¹®¼¿¡ ÃÖ±Ù¼öÁ¤ÀÏ°ú
¸¸±â½Ã°£ÀÌ ¾ø´Â °æ¿ì CacheDefaultExpire
Áö½Ã¾î·Î ÁöÁ¤ÇÑ °ªÀ» ¸¸±â½Ã°£À¸·Î »ç¿ëÇÑ´Ù.
CacheIgnoreNoLastMod On
¼³¸í: | LastModified ½Ã°£À¸·Î ¸¸±â½Ã°£À» °è»êÇϴµ¥ »ç¿ëÇÏ´Â °è¼ö. |
---|---|
¹®¹ý: | CacheLastModifiedFactor float |
±âº»°ª: | CacheLastModifiedFactor 0.1 |
»ç¿ëÀå¼Ò: | ÁÖ¼¹ö¼³Á¤, °¡»óÈ£½ºÆ® |
»óÅÂ: | Experimental |
¸ðµâ: | mod_cache |
¹®¼¿¡ ¸¸±â½Ã°£Àº ¾øÁö¸¸ ÃÖ±Ù¼öÁ¤ÀÏÀÌ ÀÖ´Â °æ¿ì ÃÖ±Ù¼öÁ¤ÀÏ
ÀÌÈÄ Áö³ ½Ã°£À¸·Î ¸¸±â½Ã°£À» °è»êÇÑ´Ù.
CacheLastModifiedFactor
Áö½Ã¾î´Â
¸¸±â½Ã°£À» °è»êÇÏ´Â ´ÙÀ½ °ø½Ä¿¡¼ »ç¿ëÇÒ factor¸¦
ÁöÁ¤ÇÑ´Ù:
expiry-period = time-since-last-modified-date * factor
expiry-date = current-date + expiry-period
¿¹¸¦ µé¾î, ¹®¼°¡ 10 ½Ã°£ Àü¿¡ ¸¶Áö¸·À¸·Î ¼öÁ¤µÇ¾ú°í factor°¡
0.1À̶ó¸é ¸¸±â±â°£Àº 10*01 = 1 ½Ã°£ÀÌ µÈ´Ù. ÇöÀç ½Ã°£ÀÌ
3:00pmÀ̶ó¸é ¸¸±â½Ã°£Àº 3:00pm + 1½Ã°£ = 4:00pmÀÌ´Ù.
¸¸±â±â°£ÀÌ CacheMaxExpire
º¸´Ù ±æ´Ù¸é
CacheMaxExpire
¸¦ »ç¿ëÇÑ´Ù.
CacheLastModifiedFactor 0.5
¼³¸í: | ¹®¼¸¦ ij½¬ÇÏ´Â ÃÊ´ÜÀ§ ÃÖ´ë½Ã°£ |
---|---|
¹®¹ý: | CacheMaxExpire seconds |
±âº»°ª: | CacheMaxExpire 86400 (ÇÏ·ç) |
»ç¿ëÀå¼Ò: | ÁÖ¼¹ö¼³Á¤, °¡»óÈ£½ºÆ® |
»óÅÂ: | Experimental |
¸ðµâ: | mod_cache |
CacheMaxExpire
Áö½Ã¾î´Â ½ÇÁ¦ ¼¹ö¸¦
°Ë»çÇÏÁö¾Ê°í ij½¬°¡´ÉÇÑ HTTP ¹®¼¸¦ À¯ÁöÇÒ ¼ö ÀÖ´Â ÃÊ´ÜÀ§
ÃÖ´ë½Ã°£À» ÁöÁ¤ÇÑ´Ù. Áï, ¹®¼´Â ÃÖ´ëÇÑ ÀÌ ¼³Á¤°ª¸¸Å ¿À·¡µÇ¾ú´Ù.
¹®¼°¡ ¸¸±â½Ã°£À» ÁöÁ¤ÇÏ¿©µµ ÀÌ ÃÖ´ë°ªÀ» ÁöŲ´Ù.
CacheMaxExpire 604800