页面速度见解告诉我为谷歌地图源启用压缩。 如果使用Apache,它build议使用mod_deflate 。 那么,我已经把下面的代码片段放在.htaccess文件中了:
<IfModule mod_deflate.c> <IfModule mod_headers.c> Header append Vary User-Agent env=!dont-vary </IfModule> <IfModule mod_filter.c> AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json <IfModule mod_mime.c> # DEFLATE by extension AddOutputFilter DEFLATE js css htm html xml </IfModule> </IfModule> </IfModule>
我已经启用mod_deflate (并自动启用mod_filter ), mod_headers和mod_mime已经启用..但是页面速度页面仍然告诉我启用压缩。 我做错了什么,或者我该怎么做?
这是页面速度错误的屏幕截图:

这些是第三方资源,您无法控制是否使用压缩(他们不会,因为这样做可能会暴露私人数据在BREACH或CRIME攻击 )。 您可以放心地忽略build议压缩从第三方站点加载的消息的消息,以及build议通过HTTPS提供内容压缩的消息。