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

¾ÆÆÄÄ¡ ¸ðµâ mod_deflate

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

¼³¸í:³»¿ëÀ» Ŭ¶óÀ̾ðÆ®·Î º¸³»±â Àü¿¡ ¾ÐÃàÇÑ´Ù
»óÅÂ:Extension
¸ðµâ¸í:deflate_module
¼Ò½ºÆÄÀÏ:mod_deflate.c

¿ä¾à

mod_deflate ¸ðµâÀº ¼­¹öÀÇ Ãâ·ÂÀ» ³×Æ®¿÷À¸·Î Ŭ¶óÀ̾ðÆ®¿¡ º¸³»±â Àü¿¡ ¾ÐÃàÇÏ´Â DEFLATE Ãâ·ÂÇÊÅ͸¦ Á¦°øÇÑ´Ù.

Áö½Ã¾îµé

ÁÖÁ¦

Âü°í

top

±ÇÀåÇÏ´Â ¼³Á¤

±ÞÇÑ »ç¶÷À» À§ÇÑ °ßº» ¼³Á¤ÀÌ´Ù. ±×·¯³ª ½Ã°£À» °¡Áö°í ¾Æ·¡ ÀÚ¼¼ÇÑ ¼³¸íÀ» ÀÐ±æ ¹Ù¶õ´Ù!

ÀϺΠtype¸¸ ¾ÐÃà

AddOutputFilterByType DEFLATE text/html text/plain text/xml

À̹ÌÁö¸¦ Á¦¿ÜÇÑ ¸ðµç °ÍÀ» ¾ÐÃà

<Location />
# ÇÊÅ͸¦ Ãß°¡ÇÑ´Ù
SetOutputFilter DEFLATE

# Netscape 4.x¿¡ ¹®Á¦°¡ ÀÖ´Ù...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08¿¡ ´õ ¹®Á¦°¡ ÀÖ´Ù
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIEÀº Netscape¶ó°í ÀÚ½ÅÀ» ¾Ë¸®Áö¸¸, ¹®Á¦°¡ ¾ø´Ù
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# À̹ÌÁö¸¦ ¾ÐÃàÇÏÁö ¾Ê´Â´Ù
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary

# ÇÁ·Ï½Ã°¡ À߸øµÈ ³»¿ëÀ» Àü´ÞÇÏÁö¾Êµµ·Ï ÇÑ´Ù
Header append Vary User-Agent env=!dont-vary
</Location>

top

¾ÐÃàÇϱâ

Ãâ·Â ¾ÐÃà

DEFLATE ÇÊÅÍ°¡ ¾ÐÃàÀ» ÇÑ´Ù. ´ÙÀ½ Áö½Ã¾î´Â Áö½Ã¾î°¡ ÀÖ´Â À§Ä¡ÀÇ ¹®¼­¸¦ ¾ÐÃàÇÑ´Ù:

SetOutputFilter DEFLATE

¸ðµç ³»¿ëÀ» ¾ÐÃàÇϸé ó¸®ÇÏÁö ¸øÇÏ´Â ºê¶ó¿ìÀú°¡ Àֱ⶧¹®¿¡ html ÆÄÀϸ¸À» ¾ÐÃàÇϱâÀ§ÇØ (¾Æ·¡ Âü°í) gzip-only-text/htmlÀ» 1·Î ¼³Á¤ÇÒÁöµµ ¸ð¸¥´Ù. À̸¦ 1ÀÌ ¾Æ´Ñ °ªÀ¸·Î ¼³Á¤ÇÏ¸é ¹«½ÃÇÑ´Ù.

º¸Åë Ưº°ÇÑ MIME type¸¸ ¾ÐÃàÇÏ·Á¸é AddOutputFilterByType Áö½Ã¾î¸¦ »ç¿ëÇÑ´Ù. ´ÙÀ½ ¼³Á¤Àº html ÆÄÀϸ¸À» ¾ÐÃàÇÑ´Ù:

<Directory "/your-server-root/manual">
AddOutputFilterByType DEFLATE text/html
</Directory>

¾ÐÃàÇÑ ÆÄÀÏÀ» ó¸®ÇÏÁö ¸øÇÏ´Â ºê¶ó¿ìÀú¿¡°Ô´Â ¾ÐÃàÇÏÁö¾Ê°í º¸³»±æÀ§ÇØ BrowserMatch Áö½Ã¾î¿¡ no-gzipÀ» ¼³Á¤ÇÑ´Ù. ÃÖÀûÀÇ °á°ú¸¦ ¾ò±âÀ§ÇØ no-gzip°ú gzip-only-text/htmlÀ» °°ÀÌ »ç¿ëÇÒ ¼ö ÀÖ´Ù. ÀÌ °æ¿ì ÀüÀÚ°¡ ÈÄÀÚ¸¦ ¹«½ÃÇÑ´Ù. À§ ÀýÀÇ ¼³Á¤ ¿¹Á¦ ÀϺθ¦ »ìÆ캸ÀÚ:

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

¸ÕÀú User-Agent ¹®ÀÚ¿­À» º¸°í Netscape Navigator ¹öÀü 4.xÀÎÁö °Ë»çÇÑ´Ù. ÀÌ ¹öÀüÀº text/htmlÀÌ ¾Æ´Ñ typeÀÇ ¾ÐÃàÀ» ó¸®ÇÏÁö ¸øÇÑ´Ù. ¹öÀü 4.06, 4.07, 4.08Àº html ÆÄÀÏ ¾ÐÃàÀ» ó¸®Çϴ´뵵 ¹®Á¦°¡ ÀÖ´Ù. ±×·¡¼­ ¿ì¸®´Â ÀÌ °æ¿ì deflate ÇÊÅ͸¦ ¿ÏÀüÈ÷ »ç¿ëÇÏÁö¾Ê´Â´Ù.

¼¼¹ø° BrowserMatch Áö½Ã¾î´Â Microsoft Internet Explorer°¡ ÀÚ½ÅÀ» "Mozilla/4"·Î ¾Ë¸®Áö¸¸ ¾ÐÃàµÈ ¿äûÀ» ó¸®ÇÒ ¼ö Àֱ⶧¹®¿¡ user agent ÃßÃøÀ» ¼öÁ¤ÇÑ´Ù. User-Agent Çì´õ¿¡¼­ "MSIE" (\b´Â "´Ü¾î °æ°è"¸¦ ¶æÇÑ´Ù) ¹®ÀÚ¿­À» ¹ß°ßÇÏ¸é ¾Õ¿¡¼­ ¼³Á¤ÇÑ Á¦¾àÀ» Ǭ´Ù.

ÁÖÀÇ

DEFLATE ÇÊÅÍ´Â Ç×»ó PHP³ª SSI¿Í °°Àº RESOURCE ÇÊÅÍ µÚ¿¡ µé¾î°£´Ù. ¶Ç, ³»ºÎ ÇÏÀ§¿äû(subrequest)¿¡ ¿µÇâÀ» ÁÖÁö ¾Ê´Â´Ù.

ÀÔ·Â ¾ÐÃàÇ®±â

mod_deflate ¸ðµâÀº ¿äûÀÇ gzip ¾ÐÃàµÈ ³»¿ëÀ» Ǫ´Â ÇÊÅ͵µ Á¦°øÇÑ´Ù. ÀÌ ±â´ÉÀ» »ç¿ëÇÏ·Á¸é ´ÙÀ½°ú °°ÀÌ SetInputFilter³ª AddInputFilter¸¦ »ç¿ëÇÏ¿© ÀÔ·ÂÇÊÅͼø¼­¿¡ DEFLATE ÇÊÅ͸¦ Ãß°¡ÇؾßÇÑ´Ù:

<Location /dav-area>
SetInputFilter DEFLATE
</Location>

¿äû¿¡ Content-Encoding: gzip Çì´õ°¡ ÀÖ´Ù¸é ÀÚµ¿À¸·Î ¾ÐÃàµÈ ³»¿ëÀ» Ǭ´Ù. gzip ¿äûÀ» ÇÒ ¼ö ÀÖ´Â ºê¶ó¿ìÀú´Â µå¹°´Ù. ±×·¯³ª ¾î¶² WebDAV Ŭ¶óÀ̾ðÆ®¿Í °°Àº Ưº°ÇÑ ÇÁ·Î±×·¥Àº ¿äû ¾ÐÃàÀ» Áö¿øÇÑ´Ù.

Content-Length¿¡ ´ëÇÑ ÁÖÀÇ

¿äû ³»¿ëÀ» Á÷Á¢ »ìÆ캻´Ù¸é, Content-Length Çì´õ¸¦ ¹ÏÁö¸¶¶ó! Content-Length Çì´õ´Â Ŭ¶óÀ̾ðÆ®°¡ º¸³½ ³»¿ëÀÇ ±æÀÌÀÌÁö, ¾ÐÃàÀ» Ǭ °á°úÀÇ ¹ÙÀÌÆ®¼ö°¡ ¾Æ´Ï´Ù.

top

ÇÁ·Ï½Ã ¼­¹ö ´Ù·ç±â

mod_deflate ¸ðµâÀº ÇÁ·Ï½Ã°¡ ÀÚ½ÅÀÌ Ä³½¬ÇÑ ÀÀ´äÀ» ÀûÀýÇÑ Accept-Encoding ¿äû Çì´õ¸¦ º¸³½ Ŭ¶óÀ̾ðÆ®¿¡°Ô¸¸ º¸³»µµ·Ï Vary: Accept-Encoding HTTP ÀÀ´ä Çì´õ¸¦ Ãß°¡ÇÑ´Ù. ±×·¡¼­ ¾ÐÃàµÈ ³»¿ëÀ» ÀÌÇØÇÒ ¼ö ¾ø´Â Ŭ¶óÀ̾ðÆ®¿¡ ¾ÐÃàµÈ ³»¿ëÀ» º¸³»Áö¾Êµµ·Ï ÇÑ´Ù.

¿¹¸¦ µé¾î, User-Agent Çì´õ µî¿¡ µû¶ó Ưº°È÷ ÇÊÅÍ Àû¿ëÀ» Ãë¼ÒÇÑ´Ù¸é, ÇÁ·Ï½Ã¿¡°Ô ÀÌ·¯ÇÑ Á¦ÇÑÀ» ¾Ë·ÁÁÖ±âÀ§ÇØ Á÷Á¢ Vary Çì´õ¿¡ Ãß°¡ÇØ¾ß ÇÑ´Ù. ¿¹¸¦ µé¾î, ¼³Á¤ÀÌ User-Agent¿¡ µû¶ó DEFLATE ÇÊÅ͸¦ Ãß°¡ÇÑ´Ù¸é ´ÙÀ½À» »ç¿ëÇÑ´Ù:

Header append Vary User-Agent

¿äû Çì´õ¿ÜÀÇ ´Ù¸¥ Á¤º¸¿¡ (¿¹¸¦ µé¾î, HTTP ¹öÀü) µû¶ó ¾ÐÃà ¿©ºÎ°¡ °áÁ¤µÈ´Ù¸é, Vary Çì´õ°ªÀ» *·Î ¼³Á¤ÇØ¾ß ÇÑ´Ù. ±×·¯¸é Ç¥ÁØÀ» µû¸£´Â ÇÁ·Ï½Ã´Â ij½ÌÀ» ÇÏÁö ¾Ê°Ô µÈ´Ù.

¿¹Á¦

Header set Vary *

top

DeflateBufferSize Áö½Ã¾î

¼³¸í:zlibÀÌ Çѹø¿¡ ¾ÐÃàÇÒ Å©±â
¹®¹ý:DeflateBufferSize value
±âº»°ª:DeflateBufferSize 8096
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Extension
¸ðµâ:mod_deflate

DeflateBufferSize Áö½Ã¾î´Â zlibÀÌ Çѹø¿¡ ¾ÐÃàÇÒ ¹ÙÀÌÆ®¼ö¸¦ ÁöÁ¤ÇÑ´Ù.

top

DeflateCompressionLevel Áö½Ã¾î

¼³¸í:Ãâ·ÂÀ» ¾ó¸¸Å­ ¾ÐÃàÇϴ°¡
¹®¹ý:DeflateCompressionLevel value
±âº»°ª:Zlib's default
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Extension
¸ðµâ:mod_deflate
Áö¿ø:This directive is available since Apache 2.0.45

DeflateCompressionLevel Áö½Ã¾î´Â »ç¿ëÇÒ ¾ÐÃà¼öÁØÀ» ¼±ÅÃÇÑ´Ù. °ªÀÌ Å¬¼ö·Ï ¾ÐÃà·üÀÌ Áõ°¡ÇÏÁö¸¸, CPU¸¦ ´õ ¸¹ÀÌ »ç¿ëÇÑ´Ù.

(°¡Àå ´ú ¾ÐÃà) 1°ú (°¡Àå ¸¹ÀÌ ¾ÐÃà) 9 »çÀÌÀÇ °ªÀ» ÁöÁ¤ÇÑ´Ù.

top

DeflateFilterNote Áö½Ã¾î

¼³¸í:¾ÐÃà·üÀ» ·Î±×¿¡ ±â·ÏÇÑ´Ù
¹®¹ý:DeflateFilterNote [type] notename
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Extension
¸ðµâ:mod_deflate
Áö¿ø:type is available since Apache 2.0.45

DeflateFilterNote Áö½Ã¾î´Â ¿äûÀÇ ¾ÐÃà·üÀ» ·Î±×¿¡ ±â·ÏÇÏ´Â ±âÈ£¸¦ ÁöÁ¤ÇÑ´Ù. ±âÈ£ À̸§Àº Áö½Ã¾î·Î ÁöÁ¤ÇÑ °ªÀÌ´Ù. Åë°è¸¦ À§ÇØ Á¢±Ù ·Î±×¿¡¼­ ±âÈ£¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù.

¿¹Á¦

DeflateFilterNote ratio

LogFormat '"%r" %b (%{ratio}n) "%{User-agent}i"' deflate
CustomLog logs/deflate_log deflate

·Î±×¿¡¼­ ´õ Á¤È®ÇÑ °ªÀ» ÃßÃâÇÏ·Á¸é type ¾Æ±Ô¸ÕÆ®·Î ±â·ÏÇÒ ÀڷḦ ¼±ÅÃÇÑ´Ù. type´Â ´ÙÀ½Áß ÇϳªÀÌ´Ù:

Input
ÇÊÅÍ ÀԷ½ºÆ®¸²ÀÇ ¹ÙÀÌÆ®¼ö¸¦ ÀúÀåÇÑ´Ù.
Output
ÇÊÅÍ Ãâ·Â½ºÆ®¸²ÀÇ ¹ÙÀÌÆ®¼ö¸¦ ÀúÀåÇÑ´Ù..
Ratio
¾ÐÃà·üÀ» (output/input * 100) ÀúÀåÇÑ´Ù. type ¾Æ±Ô¸ÕÆ®¸¦ »ý·«ÇÏ¸é »ç¿ëÇÏ´Â ±âº»°ªÀÌ´Ù.

±×·¡¼­ ÀÌ·¸°Ô ·Î±×¿¡ ±â·ÏÇÒ ¼ö ÀÖ´Ù:

Á¤¹ÐÇÑ ·Î±×

DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio

LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate_log deflate

Âü°í

top

DeflateMemLevel Áö½Ã¾î

¼³¸í:zlibÀÌ ¾ÐÃàÇÒ¶§ »ç¿ëÇÏ´Â ¸Þ¸ð¸®·®
¹®¹ý:DeflateMemLevel value
±âº»°ª:DeflateMemLevel 9
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Extension
¸ðµâ:mod_deflate

DeflateMemLevel Áö½Ã¾î´Â zlibÀÌ ¾ÐÃàÇÒ¶§ ¾ó¸¶¸¸Å­ ¸Þ¸ð¸®¸¦ »ç¿ëÇÒÁö °áÁ¤ÇÑ´Ù. (1°ú 9 »çÀÌÀÇ °ª)

top

DeflateWindowSize Áö½Ã¾î

¼³¸í:Zlib ¾ÐÃà window size
¹®¹ý:DeflateWindowSize value
±âº»°ª:DeflateWindowSize 15
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Extension
¸ðµâ:mod_deflate

DeflateWindowSize Áö½Ã¾î´Â zlib ¾ÐÃà window size¸¦ (1°ú 15 »çÀÌÀÇ °ª) ÁöÁ¤ÇÑ´Ù. ÀϹÝÀûÀ¸·Î window size°¡ Ŭ¼ö·Ï ¾ÐÃà·üÀÌ Áõ°¡ÇÑ´Ù.

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