【问题标题】:Site cache is disabled, but can't figure out where it's getting disabled?站点缓存被禁用,但无法弄清楚它在哪里被禁用?
【发布时间】:2012-09-25 12:02:51
【问题描述】:

我的 PHP 站点的 HTML <head> 标记包括:

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

但标题显示:

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

我在继承的 PHP 站点中找不到禁用缓存的任何地方(我对“缓存”进行了完整的文件内容搜索,但没有找到任何相关内容)。

我不知道还能去哪里看,所以我想问一下可以在 PHP 站点中禁用缓存的所有不同方法是什么?

【问题讨论】:

标签: php html caching


【解决方案1】:

将以下内容放在页面顶部 - 如果这可以解决问题 - 然后可能检查您的 .htaccess 或控制面板/php.ini 中的某个位置 - 只是猜测那里..

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

来源:click here

作者:Here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-03-22
    • 2021-06-27
    • 2019-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多