Last-Modified ヘッダーを送信しようとしています。ローカル コンピューターでプロジェクトを実行すると表示されますが、仮想ホストでそのコピーを実行すると Last-Modified ヘッダーがありません。
class InfoController extends Zend_Controller_Action
{
public function indexAction(){
$arr = strip_tags($this->_getParam('link'));
$material = new Application_Model_InlineMenus();
$mat = $material->preparematerial($arr);
$header= $this->getResponse()->setHeader("Last_Modified", gmdate("D, d M Y H:i:s", strtotime($mat['created']))." GMT", true);
//other parts of code
}
}
これは、ローカルマシンでプロジェクトを実行するときにfirebugにあるものです
Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection Keep-Alive
Content-Length 4563
Content-Type text/html
Date Fri, 15 Feb 2013 10:31:49 GMT
Expires Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive timeout=5, max=99
Last-Modified Thu, 14 Feb 2013 12:41:31 GMT
Pragma no-cache
Server Apache/2.2.22 (Win32) PHP/5.3.13
X-Powered-By PHP/5.3.13
そして、これは私のホスティングで得たものです
Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection keep-alive
Content-Encoding gzip
Content-Type text/html; charset=UTF-8
Date Fri, 15 Feb 2013 10:34:06 GMT
Expires Thu, 19 Nov 1981 08:52:00 GMT
Pragma no-cache
Server nginx/1.1.10
Transfer-Encoding chunked
X-Powered-By PHP/5.3.21
ローカル プロジェクトと実際のプロジェクトには 1 つの違いがあります。www ディレクトリで .htaccess を使用して、リクエストを www/public ディレクトリにリダイレクトします。
アップデート。プラグインを作成し、preDispatch() でヘッダーを設定しようとしましたが、http-code 500 を取得しました
問題解決: SSI を無効にする