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

¾ÆÆÄÄ¡ ¸ðµâ mod_deflate

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

ÀÌ ¹®¼­´Â ÃÖ½ÅÆÇ ¹ø¿ªÀÌ ¾Æ´Õ´Ï´Ù. ÃÖ±Ù¿¡ º¯°æµÈ ³»¿ëÀº ¿µ¾î ¹®¼­¸¦ Âü°íÇϼ¼¿ä.
¼³¸í:³»¿ëÀ» Ŭ¶óÀ̾ðÆ®·Î º¸³»±â Àü¿¡ ¾ÐÃàÇÑ´Ù
»óÅÂ:Extension
¸ðµâ¸í:deflate_module
¼Ò½ºÆÄÀÏ:mod_deflate.c

¿ä¾à

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

ÁÖÁ¦

Áö½Ã¾îµé

Bugfix checklist

Âü°í

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

# ÁÖÀÇ: ¾ÆÆÄÄ¡ 2.0.48±îÁö mod_setenvifÀÇ ¹ö±×¶§¹®¿¡
# À§ÀÇ Á¤±ÔÇ¥Çö½ÄÀº µ¿ÀÛÇÏÁö ¾Ê´Â´Ù. ¿øÇÏ´Â È¿°ú¸¦
# ¾ò±âÀ§ÇØ ´ÙÀ½°ú °°ÀÌ ¼öÁ¤ÇÏ¿© »ç¿ëÇÑ´Ù:
BrowserMatch \bMSI[E] !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)¿¡ ¿µÇâÀ» ÁÖÁö ¾Ê´Â´Ù.

ÁÖÀÇ

SetEnv·Î force-gzip ȯ°æº¯¼ö¸¦ ¼³Á¤ÇÏ¸é ºê¶ó¿ìÀúÀÇ accept-encoding ¼³Á¤À» ¹«½ÃÇÏ°í ¾ÐÃàµÈ °á°ú¸¦ º¸³½´Ù.

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

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

<Location /dav-area>
ProxyPass http://example.com/
SetOutputFilter INFLATE
</Location>

ÀÌ ¿¹Á¦´Â example.comÀÌ º¸³½ gzipÀ¸·Î ¾ÐÃàµÈ °á°úÀÇ ¾ÐÃàÀ» Ç®¾î¼­, ´Ù¸¥ ÇÊÅÍ°¡ ´õ ó¸®ÇÒ ¼ö ÀÖµµ·Ï ÇÑ´Ù.

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

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

DeflateAlterETag Áö½Ã¾î

¼³¸í:How the outgoing ETag header should be modified during compression
¹®¹ý:DeflateAlterETag AddSuffix|NoChange|Remove
±âº»°ª:DeflateAlterETag AddSuffix
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Extension
¸ðµâ:mod_deflate
Áö¿ø:Available in Apache 2.4.58 and later

The documentation for this directive has not been translated yet. Please have a look at the English version.

top

DeflateBufferSize Áö½Ã¾î

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

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

top

DeflateCompressionLevel Áö½Ã¾î

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

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

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

top

DeflateFilterNote Áö½Ã¾î

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

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

DeflateInflateLimitRequestBody Áö½Ã¾î

¼³¸í:Maximum size of inflated request bodies
¹®¹ý:DeflateInflateLimitRequestBody value
±âº»°ª:None, but LimitRequestBody applies after deflation
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory, .htaccess
Override ¿É¼Ç:All
»óÅÂ:Extension
¸ðµâ:mod_deflate
Áö¿ø:2.4.10 and later

The documentation for this directive has not been translated yet. Please have a look at the English version.

top

DeflateInflateRatioBurst Áö½Ã¾î

¼³¸í:Maximum number of times the inflation ratio for request bodies can be crossed
¹®¹ý:DeflateInflateRatioBurst value
±âº»°ª:DeflateInflateRatioBurst 3
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory, .htaccess
Override ¿É¼Ç:All
»óÅÂ:Extension
¸ðµâ:mod_deflate
Áö¿ø:2.4.10 and later

The documentation for this directive has not been translated yet. Please have a look at the English version.

top

DeflateInflateRatioLimit Áö½Ã¾î

¼³¸í:Maximum inflation ratio for request bodies
¹®¹ý:DeflateInflateRatioLimit value
±âº»°ª:DeflateInflateRatioLimit 200
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory, .htaccess
Override ¿É¼Ç:All
»óÅÂ:Extension
¸ðµâ:mod_deflate
Áö¿ø:2.4.10 and later

The documentation for this directive has not been translated yet. Please have a look at the English version.

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  |  fr  |  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 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 Libera.chat, or sent to our mailing lists.