2017-12-07 7 views
0

속도를 위해 사이트를 최적화하려고하고 있고 다음 스 니펫으로 htaccess 파일에서 mod_deflate를 활성화했습니다.mod_deflate가 모든 하위 디렉토리에서 작동하지 않습니다.

<IfModule mod_deflate.c> 
# Compress HTML, CSS, JavaScript, Text, XML and fonts 
AddOutputFilterByType DEFLATE application/javascript 
AddOutputFilterByType DEFLATE application/rss+xml 
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject 
AddOutputFilterByType DEFLATE application/x-font 
AddOutputFilterByType DEFLATE application/x-font-opentype 
AddOutputFilterByType DEFLATE application/x-font-otf 
AddOutputFilterByType DEFLATE application/x-font-truetype 
AddOutputFilterByType DEFLATE application/x-font-ttf 
AddOutputFilterByType DEFLATE application/x-javascript 
AddOutputFilterByType DEFLATE application/xhtml+xml 
AddOutputFilterByType DEFLATE application/xml 
AddOutputFilterByType DEFLATE application/css 

AddOutputFilterByType DEFLATE font/opentype 
AddOutputFilterByType DEFLATE font/otf 
AddOutputFilterByType DEFLATE font/ttf 
AddOutputFilterByType DEFLATE image/svg+xml 
AddOutputFilterByType DEFLATE image/x-icon 
AddOutputFilterByType DEFLATE text/css 
AddOutputFilterByType DEFLATE text/html 
AddOutputFilterByType DEFLATE text/javascript 
AddOutputFilterByType DEFLATE text/plain 
AddOutputFilterByType DEFLATE text/xml 

# Remove browser bugs (only needed for really old browsers) 
BrowserMatch ^Mozilla/4 gzip-only-text/html 
BrowserMatch ^Mozilla/4\.0[678] no-gzip 
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 
Header append Vary User-Agent 
</IfModule> 

그러나 gtmetrix를 통해 속도 테스트를 실행하면 몇 개의 파일이 아직 압축되지 않은 것입니다.

http://example.com/themes/default/assets/js/jquery.themepunch.tools.min.js 
http://example.com/themes/default/assets/js/jquery.js 
http://example.com/themes/default/assets/js/jquery.themepunch.revolution.min.js 
http://example.com/assets/js/bootstrap.min.js 
http://example.com/assets/plugins/bootstrap-select/js/bootstrap-select.min.js 
http://example.com/assets/plugins/bx-slider/jquery.bxslider.min.js 
http://example.com/assets/plugins/bootstrap-touchspin/js/jquery.bootstrap-touchspin.min.js 
http://example.com/assets/plugins/bootstrap-touchspin/css/jquery.bootstrap-touchspin.min.css 
http://example.com/themes/default/assets/css/custom-2.css 

mod_deflate에 관해서는 너무 지식이 없습니다. 위 섹션에 application 폴더가 있습니까? 하위 섹션을 드릴 다운하는 새로운 섹션을 추가해야합니까? 파일이 다소 커질 수 있습니다.

+0

사용중인 Apache 버전은 무엇입니까? – Ben

+0

버전이 Apache/2.4.25 – joeb

+0

이 모듈이 활성화되어 있는지 확인할 수 있습니까? (mod_rewrite, mod_headers, mod_deflate, mod_setenvif, mod_filter) /etc/httpd/conf.modules.d/*.conf 파일을 체크하고이 모듈들이로드되었는지 확인해야합니다. – Ben

답변

0

이것은 내 서버에서 직접 문제가되는 것으로 나타났습니다. 내 서버가 nginx를 사용했기 때문에 모든 캐시 명령어는 nginx 설정 파일 내에서 설정해야했습니다.