1
I持って自分のサーバー上のtest.html
とtest.php
、同じ内容持つという名前の2つのファイル:PHPで処理されるファイルでgzip圧縮が機能しないのはなぜですか?
RewriteEngine On
RewriteBase/
RewriteRule ^(.*)\.(php3|php4|php5|php6|html|htm) $1\.php
AddType x-mapp-php5.5 .php
AddHandler x-mapp-php5.5 .php
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
</Ifmodule>
test.html
戻っ要求:私は以下の内容を.htaccess
-filesを持っていることに加え
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>TEMPLATE</title>
</head>
<body>
TEXT
</body>
</html>
を次のヘッダー:
Connection: Keep-Alive
Content-Type: text/html
Date: Fri, 01 Jul 2016 08:32:04 GMT
Keep-Alive: timeout=2, max=200
Server: Apache
Transfer-Encoding: chunked
x-powered-by: PHP/5.5.36
アンコメント
Accept-Ranges: bytes
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 186
Content-Type: text/html
Date: Fri, 01 Jul 2016 08:42:22 GMT
Etag: "xxxxxxxx-xx-xxxxxxxxxxxxx"
Keep-Alive: timeout=2, max=200
Last-Modified: Fri, 01 Jul 2016 08:42:03 GMT
Server: Apache
Vary: Accept-Encoding
それは全く同じ内容とまったく同じヘッダが、それが返されたとき理由コンテンツは、圧縮されていない:G書換部(従ってPHPで処理beeingてなしにHTMLを使用して)、レスポンスヘッダでありますPHPで?
で
詳しい情報。 PHPの出力圧縮は有効になっていますか? (http://php.net/manual/en/zlib.configuration.php#ini.zlib.output-compression) – apokryfos