相关疑难解决方法(0)

为不起作用的字体设置过期标头

我在.htaccess文件中使用以下代码尝试为某些字体设置过期标头,但在检查我的firefox缓存和过期标头后,字体设置为从现在开始大约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"
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

apache .htaccess fonts webfonts expires-header

21
推荐指数
1
解决办法
4万
查看次数

标签 统计

.htaccess ×1

apache ×1

expires-header ×1

fonts ×1

webfonts ×1