迫于网站首页打开缓慢,在头部加了缓存静态资源文件的代码,然而发现不生效
<meta http-equiv="Cache-Control" content="max-age=7200" />
打开控制台发现缓存状态为:
Cache-Control:no-store,no-cache,must-revalidate;
Pragma: no-cache;
初步怀疑是服务器配置问题,一番度娘后发现是php.ini配置的问题,打开配置文件
#找到
session.cache_limiter
#默认为nocache,修改为none
修改后重载配置,即可生效
参考链接:
1:http://www.zxsdw.com/index.php/archives/926/
2:https://blog.csdn.net/a624193873/article/details/103130043