개발자의 노트
반응형

Tomcat 7 부터는 압축을 자체 지원한다.


server.xml에 아래처럼 설정하면 mime-type을 지정할 수 있다. (톰캣 재시작)


    <Connector port="7080" protocol="HTTP/1.1"

               connectionTimeout="20000"

               redirectPort="8443" URIEncoding="UTF-8"

               compressableMimeType="text/html,text/xml,text/plain,application/xml,application/json"

            compression="on"

    />  



응답헤더를 보면 gzip으로 넘어오는 걸 확인할 수 있다.


 

  1. Content-Encoding:
    gzip
  2. Content-Language:
    ko-KR
  3. Content-Type:
    text/html;charset=UTF-8
  4. Date:
    Thu, 27 Feb 2014 10:53:45 GMT
  5. Server:
    Apache-Coyote/1.1
  6. Transfer-Encoding:
    chunked
  7. Vary:
    Accept-Encoding



** Ehcache의 Gzip compression 를 사용하려면 다음 링크를 참조


http://misoin.tistory.com/46

profile

개발자의 노트

@곽코딩

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!