Apache

.htaccess

<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|txt|swf|pdf|swf|js)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>

nginx

 location ~ \.(jpg|jpeg|png|gif)$ {
                    expires 365d;
                }

当然你也可以配置nginx支持.htaccess

关注友儿不迷路

Last modification:June 17th, 2020 at 09:52 am
如果觉得我的文章对你有用,请随意赞赏