我在我的索引函数中添加了这个
$this->output->set_cache_header('Cache-Control: no-cache, must-revalidate');
字符串
但是发生了一个错误。
An uncaught Exception was encountered
Type: ArgumentCountError
Message: Too few arguments to function CI_Output::set_cache_header(), 1 passed in C:\xampp\htdocs\lsc\application\controllers\Home.php on line 24 and exactly 2 expected
Filename: C:\xampp\htdocs\lsc\system\core\Output.php
Line Number: 792
Backtrace:
File: C:\xampp\htdocs\lsc\application\controllers\Home.php
Line: 24
Function: set_cache_header
File: C:\xampp\htdocs\lsc\index.php
Line: 315
Function: require_once
型
有人能告诉我怎么用这个吗?
我想为我的网站设置该高速缓存,并告诉我如何在网站中使用缓存
1条答案
按热度按时间kcugc4gi1#
如果你想阻止缓存,可以使用
set_header
函数:字符串
如果要启用缓存,请将两个timestamp值传递给函数
set_cache_header
: