代码很简单,添加到.htaccess文件里面。添加之前注意先备份一遍以免出现不可逆的错误。
<FilesMatch ".(html|htm|php)$"> Header set Cache-Control "max-age=36000" </FilesMatch> <FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|eot|ttf|woff|js|css)$"> Header set Cache-Control "max-age=72000000" </FilesMatch>
上面分两部分来缓存,看缓存文件类型和时间(以秒为单位)。
本站文章除注明转载/出处外,均为本站原创或翻译。若要转载但请务必注明出处,尊重他人劳动成果。
转载请注明出处链接 : https://www.inlojv.com/4332.html