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
번호 제목 글쓴이 날짜 조회 수sort
329 Linux Install Adobe Flash Player 11.2 on CentOS/RHEL 6.5 file LynX 2014-06-28 2286
328 Xpress Engine xe 현재접속과 로그인 수 표시 addon 수정본 file [1] LynX 2016-09-20 2238
327 Linux lets'encrypt 설치 LynX 2015-12-24 2226
326 Programing Magic Square (마방진) - 4배수가 아닌 짝수 LynX 2016-07-15 2167
325 CentOS DNS 설치 LynX 2015-12-24 2157
324 Linux FreeBSD APM Source Compile LynX 2016-05-20 2145
323 Programing 웹사이트 APK 만들기 file [1] [17] LynX 2015-07-02 2103
322 Windows 7 윈도우7(Windows7) 공유폴더에 암호걸기 file [7] LynX 2013-07-25 2087
321 Server 아파치 - 톰캣 연동하기 (PHP, JSP 같이 사용하기) LynX 2014-05-19 1964
320 Programing Magic Square (마방진) - 4의 배수 LynX 2016-07-15 1906
319 APM CentOS7 에서 apache에 mod_http2 적용하기 file LynX 2017-02-07 1857
318 Programing make - 07 접미사 규칙 LynX 2017-02-22 1853
317 Linux WOW server [13] LynX 2015-01-11 1848
316 HTML Tag css, cascading style sheets, 스타일 정의 방법 [9] LynX 2015-02-06 1832
315 APM mariadb download origin address LynX 2019-06-19 1798
314 Network GNS3 메뉴 , VPCS file [34] LynX 2015-04-29 1798
313 Programing Magic Square (마방진) - 마방진코드와 나의 생각 01 LynX 2016-07-27 1741
312 Linux ODBC 설정 [30] LynX 2015-03-18 1726
311 Server sso file LynX 2013-12-18 1717
310 Programing Magic Square (마방진) - 홀수 LynX 2016-07-15 1677

XE Login