我在我的.htaccess文件中使用以下代码来尝试设置某些字体的过期标头,但在检查火狐浏览器缓存和到期标头时,该字体设置为从现在起约12小时后到期,而不是我尝试设置的1年。
这是我的代码:
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-ttf .ttf
AddType application/x-font-opentype .otf
AddType application/x-font-woff .woff
AddType image/svg+xml .svg
# Compress compressible fonts
AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-opentype image/svg+xml
# Add a far future Expires header for fonts
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
ExpiresByType application/x-font-ttf "access plus 1 year"
ExpiresByType application/x-font-opentype "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
我做错了什么?
.htaccess
是相关主题。请参阅此FAQ文章。 - Papershine