.htaccess htaccess cache-control for webp images

bhmjp9jg  于 2023-08-06  发布在  其他
关注(0)|答案(1)|浏览(80)

这是我的htaccess缓存控制策略:

<FilesMatch "\.(flv|gif|jpg|jpeg|png|ico)$"> Header set Cache-Control "max-age=31536000" </FilesMatch>

<FilesMatch "\.(js|css|pdf|swf)$"> Header set Cache-Control "max-age=31536000" </FilesMatch>

<FilesMatch "\.(html|htm|txt)$"> Header set Cache-Control "max-age=600" </FilesMatch>

<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$"> Header unset Cache-Control </FilesMatch> 

<FilesMatch "\.(eot|otf|ttf|woff|woff2|svg)$"> Header set Cache-Control "max-age=31536000" </FilesMatch>

字符串
现在,对于webp图像,是否可以设置cache-control指令?
多谢了

rekjcdws

rekjcdws1#

我通常是这样设置的,它对我很有效:

<IfModule mod_expires.c>  
ExpiresActive On  
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|form|webp)$">  
ExpiresDefault "access plus 1 year"  
</FilesMatch>  
</IfModule>

字符串

相关问题