Apache/Nginx/Varnish - GZIP은 CSS, js에서 작동하지 않습니다.

Apache/Nginx/Varnish - GZIP은 CSS, js에서 작동하지 않습니다.

현재 설정은 다음과 같습니다: Apache -> Nginx -> Ubuntu에서 실행 중인 Varnish

apache2.conf: h**p://pastebin.com/A3wehAbe

.htaccess: h**p://pastebin.com/Yre4hdSy (수축을 허용하도록 편집됨)

nginx.conf: h**p://pastebin.com/6X59CTAr (gzip 활성화)

광택제: 기본 설정

내 문제는 GZIP이 CSS나 js가 아닌 html 콘텐츠에서만 작동하는 것 같습니다.

이 도구를 사용하여 다음 위치에서 GZIP을 테스트했습니다. http://www.gidnetwork.com/tools/gzip-test.php

  1. h**p://rentsites.com.au 결과: 압축됨 예

    상태 HTTP/1.1 200 OK 서버 nginx/0.7.65 콘텐츠 유형 text/html; charset=UTF-8 x-powered-by PHP/5.3.2-1ubuntu4.22 x-pingback h**p://rentsites.com.au/xmlrpc.phpvar Accept-Encoding content-encoding gzip content-length 2281 허용 범위 바이트 날짜 2014년 1월 13일 월요일00:50:26 GMT x-varnish 785049695 785049694 13세 via 1.1 varnish 연결 종료

  2. h**p://rentsites.com.au/wp-includes/js/jquery/jquery.js 결과: 압축 없음

    상태 HTTP/1.1 200 OK 서버 nginx/0.7.65 콘텐츠 유형 애플리케이션/x-javascript 최종 수정됨 2013년 8월 21일 수요일 15:41:10 GMT 만료 2015년 1월 12일 월요일 23:17:22 GMT 캐시 제어 최대 -age=31536000, public pragma public content-length 93085 accept-ranges bytes date Mon, 2014년 1월 13일 00:27:30 GMT x-varnish 785049693 785049631 age 4208 via 1.1 varnish 연결 닫기

  3. h**p://rentsites.com.au/wp-content/themes/twentyfourteen/genericons/genericons.css 결과: 압축 없음

    상태 HTTP/1.1 200 OK 서버 nginx/0.7.65 content-type text/css 최종 수정됨 2013년 11월 12일 화요일 18:38:10 GMT 만료 2015년 1월 12일 월요일 23:16:50 GMT 캐시 제어 최대 수명 =31536000, public pragma public content-length 22680 accept-ranges bytes date Mon, 2014년 1월 13일 00:52:38 GMT x-varnish 785049696 785049621 age 5748 via 1.1 varnish 연결 닫기

도와주세요. 읽어 주셔서 감사합니다.

답변1

이를 .htaccess에 추가해야 한다는 사실이 밝혀졌습니다.

AddType text/css .css
AddType text/javascript .js

관련 정보