设置页面静态资源的浏览器缓存时间 Posted on 2018-10-24 Edited on 2019-10-18 In note Valine: 检查了一下页面加载的内容发现js, css, png等文件竟然都没加浏览器缓存… .htaccess 文件里面加入以下代码123<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|css|js|woff2)$"> Header set Cache-Control "max-age=172800, public, must-revalidate"</FilesMatch> nginx 配置加入以下代码123location ~.*\.(flv|gif|jpg|jpeg|png|ico|swf|css|js|woff2)$ { expires 2d;}