因此,在我们最近的一次发布中,我们观察到了很多事件,例如controller_action_predispatch.一旦网站上线,我们就开始注意到我们的观察者从未被人们召集过.经过一番调查后,我们的一位开发人员在第292行的Mage_Core_Model_App中找到了这段代码
if ($this->_cache->processRequest()) {
$this->getResponse()->sendResponse();
} else {
$this->_initModules();
$this->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
if ($this->_config->isLocalConfigLoaded()) {
$this->_initCurrentStore($scopeCode, $scopeType);
$this->_initRequest();
Mage_Core_Model_Resource_Setup::applyAllDataUpdates();
}
$this->getFrontController()->dispatch();
}
Run Code Online (Sandbox Code Playgroud)
正如您所看到的那样,$ this - > _ cache-> processRequest()是真的,当启用整页缓存时,您永远不会进入调度.开发人员确实找到了http_response_send_before,它可以通过任何方式进行调用,但在我看来,这是一个错误,或者如果您启用了完整页面缓存,则不应该使用这些控制器调度事件.有什么想法吗?
magento ×1