douzhiba6873 2012-09-25 12:02
浏览 46
已采纳

网站缓存被禁用,但无法弄清楚它被禁用的位置?

My PHP site's HTML <head> tag includes:

<meta http-equiv="Cache-Control" content="max-age=300"/>

Yet the headers show:

 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
        check=0
    Pragma: no-cache

I can't find anywhere in the PHP site that I've inherited that is disabling the cache (I did a full file-content search for "cache" and did not find anything relevant).

I'm not sure where else to look, so I wanted to ask what are all the different ways that caching can be disabled in a PHP site?

  • 写回答

1条回答 默认 最新

  • doubi8965 2012-09-25 12:17
    关注

    Put the following at the top of the page - if this fixes it - then maybe check your .htaccess or somewhere in the control panel / php.ini - just guessing there..

    header("Cache-Control: private, max-age=6000, pre-check=6000"); 
    header("Pragma: private"); 
    header("Expires: " . gmdate("D, d M Y H:i:s"). " GMT"); 
    

    Source: click here

    Author: Here

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大