내 사이트를 gzip하려고합니다. 하지만 실제로 작동하는지 확실하지 않습니다.
checkgzipcompression.com, WhatsMyIP.org 및 YSlow에서 확인하면 사이트가 압축되어 있지 않다는 메시지가 나타납니다. Yslow는 압축되지 않은 파일 몇 개를 가지고 있으며, 그렇게하도록 제안합니다.내 사이트를 gzipping하는 것은 htaccess를 사용하여 작동하지 않는 것 같습니다 - 아니요 Content-Encoding : gzip
이 사이트를 압축해야하는, 내 htaccess
- 파일에서 일부입니다
<IfModule mod_deflate.c>
# Force compression for mangled headers.
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
# Compress all output labeled with one of the following MIME-types
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/rss+xml \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/x-web-app-manifest+json \
application/x-httpd-php \
application/x-httpd-fastphp \
application/xhtml+xml \
application/xml \
font/opentype \
image/svg+xml \
image/x-icon \
text/css \
text/html \
text/plain \
text/x-component \
text/xml
</IfModule>
</IfModule>
이 코드는 h5bp (https://github.com/h5bp/html5-boilerplate/blob/v4.3.0/doc/TOC.md)을 기반으로합니다.
PHP 초기화 스크립트에 ini_set("zlib.output_compression", 4096);
을 추가하면 - checkgzipcompression.com과 WhatsMyIP.org 모두 내 사이트가 압축되었음을 알립니다. kb의 페이지 무게와 함께.
그러나 YSlow는 압축되지 않은 파일이 여러 개 있다고 알려줍니다.
크롬과 파이어 폭스를위한 개발자 도구에서 각 요청/파일에 대한 압축되지 않은 파일 크기를 보여줍니다. (그래도 (?) 인 경우 어떻게 될지 모르겠습니다).
Accept-Encoding: gzip,deflate
및 Vary: Accept-Encoding
이 있지만, Content-Encoding: gzip
과 같은 것은 없습니다.
방금 BlueHost와 내 서버 제공 업체와 채팅했습니다. 그들은 모든 서버에서 mod_deflate
이 자동으로 실행된다고 말했습니다. 그러나 동적이기 때문에 대부분의 웹 사이트 스캐너는 그것을 보지 못합니다.
사실은 내 사이트가 사실 압축되어 있는지 실제로 확인할 수 없다는 것이 었습니다. 이 위, 그리고 zlib.output_compression()
이 꺼져로
.htaccess
- 파일은 - 경우에 당신이 그것을 확인하는 기능이 ..
도메인은 다음과 같습니다 여기
http://barkeeper.thomaskile.me이의 acreenprint 무엇 firefox 페이지에 관해서 말을 걸고 있습니다 :
그 대답은 얼마나 정확합니까? 문제에 대한 해결책이나 가능한 원인을 제시하지 않기 때문에 주석처럼 보입니다. – Antoniossss