我的apache web服务器管理员声称,服务器支持deflate gzip压缩并且出于某种原因,向我显示环境变量HTTP_ACCEPT_ENCODING gzip,deflate
。Apache服务器压缩和杠杆浏览缓存问题
我知道有两种压缩方法。方法之一,是在PHP水平,使用ob_start('ob_gzhandler')
和第二个方法是在服务器级别,使用.htaccess
在它一些命令,像这样的
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
<FilesMatch "\\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
我用一些工具检查两种压缩方法,如page speed
第一种方法适用于我,但第二种方法不起作用。 我想使用服务器端压缩方法,并且我发现网络中有很多人有像我这样的问题。 服务器管理员只是声称everything is ok from his point of view and gzip/deflate is active
我有leverage browse caching
其他问题,谷歌推荐网站管理员使用它。
就像压缩,有标准编码.htaccess
文件,像这样的
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
不幸的是,这是行不通的像压缩。 我们的apache服务器版本是2.2.20。
我不知道如何证明服务器管理员,这是有问题的服务器安装。
也许是这个版本的apache的bug。 我真的很迷惑,特别是当我明白世界上有一些人,他们和我一样有同样的问题,而且没有回复。
Thanks..very不错......我不知道......袅袅我下载它,它适合你的例子,非常漂亮不幸的是,当我使用它像'curl --compress http:// www.mysite.com'它返回'406不可接受的错误!....我为我的新错误创建了新的问题。请参阅此[链接](http://stackoverflow.com/questions/8653271/curl-command-return-http-1-1-406-not-acceptable-error)...但没有有用的回复..这些问题到底是什么?!...谁是救赎者?!...你可以布赖恩...我知道你是男人布莱恩。 – 2011-12-28 09:03:29