사용자 도구

사이트 도구


nginx:gzip

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
nginx:gzip [2012/10/31 12:00]
kwon37xi
nginx:gzip [2015/09/15 11:25] (현재)
kwon37xi
줄 1: 줄 1:
 ====== nginx gzip ====== ====== nginx gzip ======
 텍스트 컨텐츠는 gzip 압축으로 전송해야 성능에 좋다. 텍스트 컨텐츠는 gzip 압축으로 전송해야 성능에 좋다.
-  * [[http://wiki.nginx.org/HttpGzipModule|HttpGzipModule]]+  * [[http://wiki.nginx.org/HttpGzipModule|nginx HttpGzipModule]] 
 +  * [[http://wiki.nginx.org/HttpGzipStaticModule|nginx HttpGzipStaticModule]]
   * [[http://www.euperia.com/website-performance-2/gzip-javascript-css-nginx/829|Gzip javascript and css with NGinx]]   * [[http://www.euperia.com/website-performance-2/gzip-javascript-css-nginx/829|Gzip javascript and css with NGinx]]
   * ''text/html''은 기본으로 항상 압축된다.   * ''text/html''은 기본으로 항상 압축된다.
 +  * ''gzip_static''은 정적 파일을 미리 gzip으로 압축해 두면 압축 프로세싱 과정 없이 즉시 해당 압축 파일을 전송한다. 예를들어 ''test.js''파일에 대한 요청이 올 경우 ''test.js.gz''를 찾아서 해당 파일이 존재하면 압축된 버전을 전송하고, 없으면 원본 파일을 압축한 뒤에 전송한다. CPU 점유율이 낮아지고 성능이 향상된다.
 <code> <code>
-gzip  on; +gzip on; 
-gzip_disable     "msie6"; // 자동으로 IE6, 5.5를 감지해서 disable한다. +gzip_static on; 
-gzip_disable "MSIE [1-6]\.(?!.*SV1)"; // nginx 0.7 이하에서만 +gzip_disable     "msie6"; 자동으로 IE6, 5.5를 감지해서 disable한다. 
-gzip_types application/x-javascript application/javascript application/xml+gzip_disable "MSIE [1-6]\.(?!.*SV1)"; nginx 0.7 이하에서만 
-gzip_types text/javascript application/json text/json text/css text/plain application/xhtml+xml application/rss+xml ;+gzip_types application/x-javascript application/javascript application/xml text/javascript application/json text/json text/css text/plain application/xhtml+xml application/rss+xml ;
 </code> </code>
 +
 +====== nginx 1.2 HEAD / gzip 관련 버그 ======
 +  * nginx 1.2 대에는 HEAD 요청이 들어올 때 ''Accept-Encoding: gzip, deflate''가 있으면 HEAD의 결과에 쓰레기 데이터가 쌓이는 문제가 있다.
 +  * [[http://trac.nginx.org/nginx/ticket/261|#261 (HEAD requests still have content-type when gzip on)]]
 +  * [[https://trac.nginx.org/nginx/ticket/358|HEAD request with Accept-Encoding: gzip returns a response body]]
 +  * 최신 버전으로 업그레이드하거나, HEAD에 대해 gzip을 꺼버릴 것.
 +
nginx/gzip.1351652410.txt.gz · 마지막으로 수정됨: 2012/10/31 12:00 저자 kwon37xi