[Codeigniter-users] ヘッダー制御

Back to archive index

ikari****@ecoin***** ikari****@ecoin*****
2009年 6月 6日 (土) 12:29:14 JST


お世話になります
碇です

テストコード1
class Test extends Controller{
function __construct(){
	parent::Controller();
	$this->output->set_header("Content-Type: text/xml");
	$this->output->set_header("Cache-Control: no-cache");
	$this->output->set_header("Pragma: no-cache");
	$this->output->set_header("Expires: 0");
}
function index(){
	echo '<?xml version="1.0" encoding="utf-8" ?>';
	echo '<a>a</a>';
}
}	

テストコード2
class Test extends Controller{
function __construct(){
	parent::Controller();
}

function index(){
	$this->output->set_header("Content-Type: text/xml");
	$this->output->set_header("Cache-Control: no-cache");
	$this->output->set_header("Pragma: no-cache");
	$this->output->set_header("Expires: 0");
	echo '<?xml version="1.0" encoding="utf-8" ?>';
	echo '<a>a</a>';
}
}

}	

このようにしてみましたが動作していないようです
以上よろしくお願いします

On Sat, 6 Jun 2009 07:38:31 +0900
Kenji <kenji****@club*****> 様wrote:

> Kenji です。
> 
> 
> On Sat, 06 Jun 2009 00:38:57 +0900
> ikari****@ecoin***** wrote:
> 
> > お世話になります
> > 碇です
> > 
> > キャッシュコントロールをしたいためHTTPヘッダーを制御したいです
> > マニュアルを見る限り
> > $this->output->set_header("Cache-Control: no-cache");
> > $this->output->set_header("Pragma: no-cache");
> > $this->output->set_header("Expires: 0");
> > 
> > このような記述ができるようで
> > 
> > __construct()内やindex()でよんでみたのですが
> > Live HTTP headers
> > で見る限りはヘッダにセットされていないようです
> > 
> > どのようにしたらヘッダを制御できるでしょうか?
> 
> それで動作するはずです。
> 
> 動作しないサンプルコードがあれば、動作しない理由が
> わかるかも知れません。
> 
> 
> // Kenji
> 
> _______________________________________________
> Codeigniter-users mailing list
> Codei****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/codeigniter-users

-- 
碇 永志
 <ikari****@ecoin*****>




Codeigniter-users メーリングリストの案内
Back to archive index