2010-08-19 5 views
1

로컬 wamp 설정을했고 deflate_module을 아파치에 설치했습니다.gzip이 로컬에서 작동하는지 테스트

또한 .htaccess에서 다음 규칙을 설정했습니다.

<IfModule mod_deflate.c> 
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/json 

</IfModule> 

하지만 작동하는지 어떻게 테스트 할 수 있습니까? 파일을 gzip하고 있는지 어떻게 알 수 있습니까?

감사합니다.

답변

1

netcat을 사용하고 Accept-Encoding: gzip,deflate을 전송하십시오. 압축 된 mumbo-jumbo가 반환되면 파일이 gzip됩니다.

예 :

GET/HTTP/1.1 
Host: www.yourdomain.org 
Accept: text/xml,application/xml,application/xhtml+xml,text/html,text/plain,image/png,image/jpeg,image/gif 
Accept-Language: en-us,en 
Accept-Encoding: gzip,deflate 
Connection: close 

마지막에 두 줄 바꿈을 추가하는 것을 잊지 마십시오.

+2

사실 - 응답 헤더에서 "Content-Encoding : gzip"을 볼 수만 있습니까? Firebug for Firefox 사용하기. – mindwire22

+0

그게 잘 작동한다면, 콘솔에서 내 작업을 대부분하고 비슷한 일을하는 스크립트를 가지고 있기 때문에 netcat 방식을 선호합니다. – polemon

2

또한 것이다 curl (download here)

명령을 사용하는 것이 좋습니다 것 : 웹 페이지 요청에서 헤더를 인쇄합니다 curl --head --compressed http://yourdomain.com/yourpage.html

합니다. 다음 줄을 찾으십시오 : Content-Encoding: gzip. 그곳에 없다면 제대로 구성되지 않은 것입니다.