Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP-会话缓存限制器()和头之间的区别?_Php_Caching_Cache Control - Fatal编程技术网

PHP-会话缓存限制器()和头之间的区别?

PHP-会话缓存限制器()和头之间的区别?,php,caching,cache-control,Php,Caching,Cache Control,我想知道他们之间是否有什么不同: session_cache_limiter('nocache'); 和标题: header("Cache-Control:no-store,no-cache,must-revalidate,max-age=0"); header("Cache-Control:post-check=0,pre-check=0",false); header("Pragma:no-cache"); 假设我不需要任何缓存。对于所有从谷歌搜索到这里并感到迷路的人 如果使用会话,请在

我想知道他们之间是否有什么不同:

session_cache_limiter('nocache');
和标题:

header("Cache-Control:no-store,no-cache,must-revalidate,max-age=0");
header("Cache-Control:post-check=0,pre-check=0",false);
header("Pragma:no-cache");

假设我不需要任何缓存。

对于所有从谷歌搜索到这里并感到迷路的人

如果使用会话,请在会话开始之前调用会话缓存限制器


如果不使用会话,则直接发送头,因为
会话缓存限制器
仅与
会话启动
结合使用

会话缓存限制器用于会话存储,头用于http数据输出所以如果我在没有会话的情况下使用会话缓存限制器,是否错误?