Luk*_*ann 5 apache favicon optimization etag yslow
在项目中使用yslow我遇到了一个"问题",我无法解决.
Yslow一直在抱怨:
有一个组件配置错误的ETag http://www.domain.com/favicon.ico
我的.htaccess文件中有以下内容
# Add Proper MIME-Type for Favicon
AddType image/x-icon .ico
# Enable Apache's mod_expires Module
ExpiresActive On
ExpiresByType image/x-icon "access plus 6 month"
<ifModule mod_headers.c>
Header unset ETag
</ifModule>
FileETag None
Run Code Online (Sandbox Code Playgroud)
有没有人知道如何解决它?
小智 6
添加这个:
ExpiresByType image/ico "access plus 1 years"
Run Code Online (Sandbox Code Playgroud)
我的.htaccess档案:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A0
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/ico "access plus 1 month"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/ico "access plus 1 years"
</IfModule>
Header unset ETag
FileETag None
Run Code Online (Sandbox Code Playgroud)