图像/avif 的 ExpiresByType 指令不起作用

问题描述 投票:0回答:1

我的 .htaccess 文件中有以下内容:

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 week"

ExpiresByType font/woff "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
# Images
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/avif "access plus 1 year"

and so on...

我添加了行

ExpiresByType image/avif "access plus 1 year"
来覆盖
avif
文件,就像
jpeg
类型一样,但该指令似乎不起作用。 Pagespeed 表示
avif
文件在缓存中只有 7 天。其他文件处理得很好。你能解释一下吗?

apache .htaccess mod-expires avif
1个回答
0
投票

查看我的托管公司注册的 MIME 类型,我发现缺少

avif
类型。 因此,我在 cPanel/MIME Types/User Defined MIME Types
image/avif
处手动添加了扩展名
avif
。仅此而已。

© www.soinside.com 2019 - 2024. All rights reserved.