You cannot see this page without javascript.

Apache httpd 2.4 mod_deflate

APM 조회 수 431 추천 수 0 2016.12.23 11:37:41
먼저 사용할 모듈들을 로드하도록 하고,
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule filter_module modules/mod_filter.so
 
다음과 같은 확장자 규정이 있다면 넘어가고, 없다면 추가한다.

AddType text/html .html .htm
AddType text/css .css
AddType application/xml .xml
AddType application/javascript .js
AddType application/x-httpd-php .php .php3 .html .htm .phtml .inc
AddType application/x-httpd-php-source .phps

 

다음과 같은 유형들은 압축하도록 설정하고,

AddOutputFilterByType DEFLATE text/plain text/html text/xml
AddOutputFilterByType DEFLATE application/xhtml+xml application/xml application/rss+xml
AddOutputFilterByType DEFLATE text/css application/javascript application/x-javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/php
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE audio/midi

 

사용할 압축레벨을 선택하는데, 값이 클수록 압축률이 증가하지만, CPU를 더 많이 사용한다.

기본값은 설치된 gzip설정을 따른다.
#DeflateCompressionLevel 9

 

지원불가능 브라우져에 대한 설정을 한다.

# Netscape 4.xx에는 HTML만 압축해서 보냄
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06~4.08에는 압축해서 보내지 않음
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# 자신을 Mozilla로 알리는 MSIE에는 그대로 압축해서 보냄
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

 

압축하지 않을 파일들을 지정한다.
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|bmp|zip|tar|rar|alz|a00|ace|txt|mp3|mpe?g|wav|asf|wma|wmv|swf|exe|pdf|doc|xsl|hwp|java|c|t?gz|bz2|7z)$ no-gzip dont-vary

 

tc-def.png

 

첨부
엮인글 :
List of Articles
번호 제목 글쓴이 날짜 조회 수
329 APM CentOS7 에서 apache에 mod_http2 적용하기 file LynX 2017-02-07 1856
328 CentOS CentOS7 WHEEL 계정 추가 file LynX 2017-02-03 275
327 APM MySQL 5.7 바이너리 Archive 설치 file LynX 2017-02-02 603
326 CentOS centos7 gcc-4.9.2 compile install LynX 2017-01-25 1448
325 CentOS CentOS7 mono 설치 LynX 2016-12-30 1621
324 APM hhvm install file LynX 2016-12-28 420
» APM Apache httpd 2.4 mod_deflate file LynX 2016-12-23 431
322 Server 사이트 품질 측정 website.grader.com LynX 2016-12-22 216
321 Linux linux starcraft private server build, pvpgn LynX 2016-12-06 341
320 Network pka파일 만드는 방법 file LynX 2016-10-24 1588
319 APM php opcache 설치 file LynX 2016-10-14 1423
318 Linux linux 시간설정 file LynX 2016-10-07 398
317 LinuxMint joystick install file LynX 2016-09-30 475
316 Linux MAME file LynX 2016-09-28 320
315 APM PHP Suhosin 설치 file LynX 2016-09-28 222
314 Xpress Engine mobileex 사용하여 모바일에서 첨부파일 올릴때 무한 로딩 현상 LynX 2016-09-27 239
313 Xpress Engine XE에 memcache 사용 설정 LynX 2016-09-23 242
312 APM php에 memcached.so 확장 모듈 적용 file LynX 2016-09-23 221
311 APM php7에 memcache.so 확장 모듈 적용 file LynX 2016-09-23 415
310 Xpress Engine xe 현재접속과 로그인 수 표시 addon 1.3.0 file LynX 2016-09-22 1522

XE Login