Y慢& Google Page Speed 关于 .htaccess 冲突的建议
预先感谢您的帮助。
我一直在尝试 YSlow 和 Google 页面速度,两者都提供了非常有用的建议,并且似乎没有一个比另一个更有优势,但当涉及到实体标签时,它们似乎在某种程度上存在分歧或冲突。以下代码满足 YSlows“配置实体标记 (ETags)”指针,
Header unset ETag
FileETag None
<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header unset Last-Modified
Header set Expires "Fri, 21 Dec 2050 00:00:00 GMT"
Header set Cache-Control "public, no-transform"
</FilesMatch>
但是使用此代码后,Google Page Speed 会提供以下建议“指定缓存验证器”。另一位成员Aularon建议使用此代码来满足Google的要求
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 year"
</IfModule>
两者分开工作,但是这两个解决方案都不能满足两个验证者的要求,所以我的问题是。
- 我应该关心吗?
- 对于两个验证器来说有一个好的解决方案吗?
- 这两种解决方案真的会产生重大影响吗?
Thanks in advance for your help.
I've been experimenting with YSlow and Google page speed, both provide very helpful advice and neither seems to have an advantage over the other but when it comes to Entity tags they seem to disagree or conflict in some way. The following code satisfies YSlows 'Configure entity tags (ETags)' pointer
Header unset ETag
FileETag None
<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header unset Last-Modified
Header set Expires "Fri, 21 Dec 2050 00:00:00 GMT"
Header set Cache-Control "public, no-transform"
</FilesMatch>
However with this code in place Google Page Speed provides the following advice 'specify a cache validator'. Another member Aularon suggests using this code to satisfy Google's requirement
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 year"
</IfModule>
Both work separately, but neither solution satisfies both validators, so my questions are.
- Should I care?
- Is there a good solution for both validators?
- Does either solution really have a major impact?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)