gpt4 book ai didi

.htaccess - 浏览器缓存工作除了 svg-images

转载 作者:行者123 更新时间:2023-12-01 13:52:41 24 4
gpt4 key购买 nike

我在浏览器缓存 SVG 文件时遇到问题。

在我的 .htaccess 中,一切似乎都很好(至少它相当完整)但无论我尝试什么,似乎 SVG 图像都没有进入浏览器的缓存。


<IfModule mod_expires.c>
ExpiresActive On
...
(various other file-types)
...
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresDefault "access plus 1 month"
</IfModule>

在 .htaccess 中,我试过
ExpiresByType image/svg+xml A2592000

也是,但没有任何效果。我还尝试将 mime-type 更改为 text/svg+xml。也不好。

什么可能导致这种失败?

谢谢

最佳答案

根据@Ariel 的建议,我检查了我的 .conf 文件,但我仍然遇到同样的问题,尽管我添加了

ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType image/svg "access plus 1 month"

即使它对 svg 字体有效(我假设)。我没有 .htaccess,所以一切都在 .conf 文件中完成。在那张纸条上,我也有
    <FilesMatch "\.(jpg|png|css|js|swf)$">
Header unset Cache-Control
</FilesMatch>

但据我所知,它甚至不会触及 svg 文件。谢谢

关于.htaccess - 浏览器缓存工作除了 svg-images,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32638868/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com