Zend framework zend can';不发送上次修改的标题
我尝试发送上次修改的标题。在本地计算机上运行project时可以看到它,但在虚拟主机上运行它的副本时,并没有最后修改的标头Zend framework zend can';不发送上次修改的标题,zend-framework,http-headers,Zend Framework,Http Headers,我尝试发送上次修改的标题。在本地计算机上运行project时可以看到它,但在虚拟主机上运行它的副本时,并没有最后修改的标头 class InfoController extends Zend_Controller_Action { public function indexAction(){ $arr = strip_tags($this->_getParam('link')); $material = new Application_Model
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
本地项目和真实项目之间只有一个区别——我在www directority中使用.htaccess将请求重定向到www/public目录
UPD。我创建了插件,并在preDispatch()中尝试设置头,得到了http代码500
问题已解决:禁用SSI不应
Last\u Modified
应Last Modified
?原始标题应为Last Modified,但在这种情况下,应为Last\u Modified。无论如何,标题(“上次修改:”.gmdate(“D,D M Y H:i:s”)“GMT”)也不起作用。我使用了一个简单的php测试文件,它只发送头,不发送任何内容,然后客户端接收它。尝试将setter替换为canSendHeaders()
。它是否返回true?在我的本地计算机(win x86 wamp)上,它始终返回true,即使我以前向客户端发送了一些内容。例如,var_转储($arr);echo$this->getResponse()->canSendHeaders()呈现“1”禁用SSI工作