<-
Apache > HTTP Server > Documentation > Version 2.2 > ¸ðµâ

Please note

This document refers to a legacy release (2.2) of Apache httpd. The active release (2.4) is documented here. If you have not already upgraded, please follow this link for more information.

You may follow this link to go to the current version of this document.

¾ÆÆÄÄ¡ ¸ðµâ mod_expires

°¡´ÉÇÑ ¾ð¾î:  en  |  ja  |  ko 

ÀÌ ¹®¼­´Â ÃÖ½ÅÆÇ ¹ø¿ªÀÌ ¾Æ´Õ´Ï´Ù. ÃÖ±Ù¿¡ º¯°æµÈ ³»¿ëÀº ¿µ¾î ¹®¼­¸¦ Âü°íÇϼ¼¿ä.
¼³¸í:»ç¿ëÀÚ°¡ ÁöÁ¤ÇÑ ±âÁØ¿¡ µû¶ó Expires¿Í Cache-Control HTTP Çì´õ¸¦ »ý¼ºÇÑ´Ù
»óÅÂ:Extension
¸ðµâ¸í:expires_module
¼Ò½ºÆÄÀÏ:mod_expires.c

¿ä¾à

ÀÌ ¸ðµâÀº ¼­¹ö ÀÀ´äÀÇ Expires HTTP Çì´õ¿Í Cache-Control HTTP Çì´õÀÇ max-age Áö½Ã¾î ¼³Á¤À» Á¶ÀýÇÑ´Ù. ¸¸±âÀÏÀ» ÆÄÀÏÀÌ ¸¶Á÷¸· ¼öÁ¤µÈ ½Ã°£ ȤÀº Ŭ¶óÀ̾ðÆ®°¡ Á¢¼ÓÇÑ ½Ã°£¿¡ »ó´ëÀûÀ¸·Î ¼³Á¤ÇÒ ¼ö ÀÖ´Ù.

ÀÌ HTTP Çì´õµéÀº Ŭ¶óÀ̾ðÆ®¿¡°Ô ¹®¼­ÀÇ À¯È¿¼º°ú Áö¼Ó¼ºÀ» ¾Ë·ÁÁØ´Ù. ÀÌ ½Ã°£ÀÌ ¾ÆÁ÷ Áö³ªÁö¾Ê¾Ò´Ù¸é, ¹®¼­¸¦ ij½¬¿¡¼­ °¡Á®¿Íµµ µÈ´Ù. ¸¸±âÀÏÀÌ Áö³µ´Ù¸é ij½¬µÈ °ÍÀ» "¸¸·áµÇ°í" À¯È¿ÇÏÁö ¾Ê´Ù°í °£ÁÖÇÏ¿©, ¼Ò½º¿¡¼­ ¹®¼­¸¦ »õ·Î ¾ò¾î¿Í¾ß ÇÑ´Ù.

Header Áö½Ã¾î¸¦ »ç¿ëÇÏ¿© max-age ¿ÜÀÇ ´Ù¸¥ Cache-Control Áö½Ã¾î(RFC 2616, 14.9 Àý Âü°í)¸¦ ¼öÁ¤ÇÒ ¼ö ÀÖ´Ù.

ÁÖÁ¦

Áö½Ã¾îµé

top

´Ù¸¥ ³»ºÎ ¹®¹ý

ExpiresDefault¿Í ExpiresByType Áö½Ã¾î¸¦ ´õ Àбâ ÁÁÀº Çü½ÄÀ¸·Î ±â¼úÇÒ ¼ö ÀÖ´Ù:

ExpiresDefault "<base> [plus] {<num> <type>}*"
ExpiresByType type/encoding "<base> [plus] {<num> <type>}*"

<base>´Â ´ÙÀ½Áß ÇϳªÀÌ´Ù:

plus Å°¿öµå´Â ¾ø¾îµµ µÈ´Ù. <num>Àº [atoi()¿¡ »ç¿ëÇÒ ¼ö ÀÖ´Â] Á¤¼ö°ªÀÌ´Ù. <type>Àº ´ÙÀ½Áß ÇϳªÀÌ´Ù:

¿¹¸¦ µé¾î, ´ÙÀ½ ¸ðµÎ´Â ¹®¼­°¡ ±âº»ÀûÀ¸·Î Á¢¼ÓµÈÁö 1´ÞÈÄ¿¡ ¸¸±âµÈ´Ù°í ¼³Á¤ÇÑ´Ù:

ExpiresDefault "access plus 1 month"
ExpiresDefault "access plus 4 weeks"
ExpiresDefault "access plus 30 days"

'<num> <type>' ±¸¹®À» ¹Ýº¹Çؼ­ »ç¿ëÇÏ¿© ¸¸±â½Ã°£À» ÀÚ¼¼È÷ ¼³Á¤ÇÒ ¼ö ÀÖ´Ù:

ExpiresByType text/html "access plus 1 month 15 days 2 hours"
ExpiresByType image/gif "modification plus 5 hours 3 minutes"

¸¸¾à ¼öÁ¤½Ã°£(modification)À» ±âÁØÀ¸·Î ¸¸±â½Ã°£À» ¼³Á¤ÇÏ´Â °æ¿ì ³»¿ëÀ» µð½ºÅ©¿¡ ÀÖ´Â ÆÄÀÏ¿¡¼­ °¡Á®¿ÀÁö ¾Ê´Â´Ù¸é Expires Çì´õ¸¦ ºÙÀÌÁö ¾Ê´Â´Ù. ÀÌ °æ¿ì ³»¿ë¿¡ ¼öÁ¤½Ã°£ÀÌ ¾ø±â ¶§¹®ÀÌ´Ù.

top

ExpiresActive Áö½Ã¾î

¼³¸í:Expires Çì´õ¸¦ »ý¼ºÇÑ´Ù
¹®¹ý:ExpiresActive On|Off
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory, .htaccess
Override ¿É¼Ç:Indexes
»óÅÂ:Extension
¸ðµâ:mod_expires

ÀÌ Áö½Ã¾î´Â ÇØ´ç ¿µ¿ª¿¡ ´ëÇØ (Áï, .htaccess ÆÄÀÏ¿¡¼­ »ç¿ëÇÑ´Ù¸é ±× µð·ºÅ丮 ¾Æ·¡¿¡ ÀÖ´Â ¹®¼­µé¸¸ ÇØ´çµÈ´Ù.) Expires¿Í Cache-Control Çì´õ¸¦ »ý¼ºÇÒÁö À¯¹«¸¦ °áÁ¤ÇÑ´Ù. (.htaccess ÆÄÀÏ µîÀ¸·Î ´õ ÇÏÀ§ ´Ü°è¿¡¼­ ¼­¹ö¼³Á¤À» º¯°æÇÏÁö¾Ê´Â ÇÑ) OffÀ̸é ÇØ´ç ¿µ¿ª¿¡ ÀÖ´Â ¹®¼­¿¡ À̵é Çì´õ¸¦ »ý¼ºÇÏÁö ¾Ê´Â´Ù. OnÀ̸é ExpiresByType°ú ExpiresDefault Áö½Ã¾î·Î (ÇØ´ç Ç׸ñÀ» Âü°íÇ϶ó) ÁöÁ¤ÇÑ ±ÔÄ¢¿¡ µû¶ó ¼­ºñ½ºÇÏ·Á´Â ¹®¼­¿¡ ÀÌ Çì´õµéÀ» »ý¼ºÇÑ´Ù.

ÀÌ Áö½Ã¾î°¡ Expires³ª Cache-Control Çì´õ¸¦ º¸ÀåÇÏÁö´Â ¾Ê´Â´Ù. ±ÔÄ¢¿¡ ÇØ´çÇÏÁö ¾Ê´Ù¸é ¸¶Ä¡ ÀÌ Áö½Ã¾î°¡ ¾ø´Â °Íó·³ Çì´õ¸¦ ¸¸µéÁö ¾Ê´Â´Ù.

top

ExpiresByType Áö½Ã¾î

¼³¸í:MIME typeÀ¸·Î Expires Çì´õ°ªÀ» ¼³Á¤ÇÑ´Ù
¹®¹ý:ExpiresByType MIME-type <code>seconds
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory, .htaccess
Override ¿É¼Ç:Indexes
»óÅÂ:Extension
¸ðµâ:mod_expires

ÀÌ Áö½Ã¾î´Â ƯÁ¤ Á¾·ùÀÇ (¿¡¸¦ µé¾î, text/html) ¹®¼­¿¡ ´ëÇÑ Expires Çì´õ°ª°ú Cache-Control Çì´õÀÇ max-age Áö½Ã¾î°ªÀ» Á¤ÀÇÇÑ´Ù. µÎ¹ø° ¾Æ±Ô¸ÕÆ®´Â ¸¸±â½Ã°£À» °áÁ¤ÇÒ¶§ ±âÁØ ½Ã°£¿¡ ´õÇÒ ÃÊ´ÜÀ§ °ªÀ» ÁöÁ¤ÇÑ´Ù. Cache-Control: max-age´Â ¸¸±â½Ã°£¿¡¼­ ¿äûÇÑ ½Ã°£À» »©¼­ °è»êÇÏ°í, °á°ú´Â ÃÊ´ÜÀ§·Î Ç¥½ÃÇÑ´Ù.

±âÁØ ½Ã°£Àº ÆÄÀÏÀÇ ÃÖ±Ù ¼öÁ¤½Ã°£ ȤÀº Ŭ¶óÀ̾ðÆ®°¡ ¹®¼­¿¡ Á¢±ÙÇÑ ½Ã°£ÀÌ´Ù. À̶² °ÍÀ» »ç¿ëÇÒÁö´Â <code> Çʵå·Î °áÁ¤ÇØ¾ß ÇÑ´Ù. MÀº ±âÁØ ½Ã°£À¸·Î ÆÄÀÏÀÇ ÃÖ±Ù ¼öÁ¤½Ã°£À» »ç¿ëÇÏ°í, A´Â Ŭ¶óÀ̾ðÆ®ÀÇ Á¢±Ù ½Ã°£À» »ç¿ëÇÑ´Ù.

Â÷ÀÌ´Â ¹Ì¹¦ÇÏ´Ù. MÀ» »ç¿ëÇϸé ij½¬¿¡ ÀÖ´Â ¸ðµç º¹»çº»ÀÌ °°Àº ½Ã°£¿¡ ¸¸·áµÈ´Ù. ±×·¡¼­ Ç×»ó °°Àº URL·Î ã¾Æº¼ ¼ö ÀÖ´Â ÁÖ°£ÀÏÁ¤ °°Àº ¿ëµµ¿¡ ÁÁ´Ù. A¸¦ »ç¿ëÇÏ¸é º¹»çº»ÀÇ ¸¸±â½Ã°£ÀÌ °¢°¢ ´Ù¸£´Ù. ÀÌ´Â ÀÚÁÖ ¼öÁ¤µÇÁö¾Ê´Â ±×¸²ÆÄÀÏ¿¡, ƯÈ÷ ¿©·¯ ¹®¼­¿¡¼­ °°Àº ±×¸²À» ÂüÁ¶ÇÒ¶§ (¿¹¸¦ µé¾î, À̹ÌÁö´Â »ó´ëÀûÀ¸·Î ªÀº ±â°£µ¿¾È ¹Ýº¹Çؼ­ Á¢±ÙµÈ´Ù), À¯¿ëÇÏ´Ù.

¿¹Á¦:

# ¸¸±âÇì´õ¸¦ »ç¿ëÇÑ´Ù
ExpiresActive On
# Ŭ¶óÀ̾ðÆ® ij½¬ÀÇ GIF ±×¸²Àº ÇÑ ´ÞÈÄ¿¡ ¸¸±âÇÑ´Ù
ExpiresByType image/gif A2592000
# HTML ¹®¼­´Â º¯°æÈÄ ÀÏÁÖÀÏ°£ À¯È¿ÇÏ´Ù ExpiresByType text/html M604800

ÀÌ Áö½Ã¾î´Â ExpiresActive OnÀ» »ç¿ëÇÒ¶§¸¸ À¯È¿ÇÔÀ» ÁÖÀÇÇ϶ó. ExpiresDefault Áö½Ã¾î¸¦ »ç¿ëÇÏ¿© ƯÁ¤ MIME type¿¡ ´ëÇؼ­¸¸ ¸¸±â½Ã°£À» ¼³Á¤ÇÒ ¼ö ÀÖ´Ù.

¾Õ¿¡¼­ ¼³¸íÇÑ ´Ù¸¥ ¹®¹ýÀ» »ç¿ëÇÏ¿© ¸¸±â½Ã°£À» °è»êÇÒ ¼öµµ ÀÖ´Ù.

top

ExpiresDefault Áö½Ã¾î

¼³¸í:¸¸±â½Ã°£À» °è»êÇÏ´Â ±âº» ¾Ë°í¸®Áò
¹®¹ý:ExpiresDefault <code>seconds
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory, .htaccess
Override ¿É¼Ç:Indexes
»óÅÂ:Extension
¸ðµâ:mod_expires

ÀÌ Áö½Ã¾î´Â ÇØ´ç ¿µ¿ª¿¡ ÀÖ´Â ¸ðµç ¹®¼­ÀÇ ¸¸±â½Ã°£À» °è»êÇÏ´Â ±âº» ¾Ë°í¸®ÁòÀ» ÁöÁ¤ÇÑ´Ù. ExpiresByType Áö½Ã¾î¸¦ »ç¿ëÇÏ¿© Á¾·ùº°·Î ¼³Á¤ÇÒ ¼ö ÀÖ´Ù. ¾Æ±Ô¸ÕÆ® ¹®¹ý¿¡ ´ëÇÑ ÀÚ¼¼ÇÑ ¼³¸íÀº ±× Áö½Ã¾î¿Í ´Ù¸¥ ¹®¹ýÀ» Âü°íÇ϶ó.

°¡´ÉÇÑ ¾ð¾î:  en  |  ja  |  ko 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.