gpt4 book ai didi

caching - magento https + IE8 提示问题

转载 作者:太空宇宙 更新时间:2023-11-03 13:56:29 26 4
gpt4 key购买 nike

我使用的是 magento 企业版 1.9,自定义主题后,网站上线了。但问题是当我在 IE8 中打开该站点时,它发出警告,如该页面不安全,因为该页面同时加载了 http/https 内容。

在我为 magento CE 1.4 得到类似的东西之前的某个时候,据我所知它正在工作。

getCacheKey的默认代码

public function getCacheKey()
{
return 'CATALOG_NAVIGATION_' . Mage::app()->getStore()->getId()
. '_' . Mage::getDesign()->getPackageName()
. '_' . Mage::getDesign()->getTheme('template')
. '_' . Mage::getSingleton('customer/session')->getCustomerGroupId()
. '_' . md5($this->getTemplate() . $this->getCurrenCategoryKey());
}

然后被下面的代码替换

public function getCacheKey()
{
return 'CATALOG_NAVIGATION_' . Mage::app()->getStore()->getId()
. '_' . Mage::getDesign()->getPackageName()
. '_' . Mage::getDesign()->getTheme('template')
. '_' . Mage::getSingleton('customer/session')->getCustomerGroupId()
. '_' . md5($this->getTemplate() . $this->getCurrenCategoryKey())
**. '_' . md5($this->getSkinUrl());**
}

就是这样。您现在可以在 Internet Explorer 上正常使用 https。

通过添加此行,每当加载 https 页面时,皮肤也会进入 https,所以我当时没有收到错误。但是在 EE 1.9 中我找不到这个函数在 Mage_Catalog_Block_Navigation 中。

我试过命令行,

find -type f -print0 | xargs -0 grep -i "getCacheKey()"

这不会以这种方式返回函数,该函数具有一些其他缓存信息。

有人解决过这个问题吗?请帮助找到这个函数。

最佳答案

我在 DOCROOT\app\code\core\Mage\Catalog\Block\Navigation.php 中看到以下代码块:

/**
* Get Key pieces for caching block content
*
* @return array
*/
public function getCacheKeyInfo()
{
$shortCacheId = array(
'CATALOG_NAVIGATION',
Mage::app()->getStore()->getId(),
Mage::getDesign()->getPackageName(),
Mage::getDesign()->getTheme('template'),
Mage::getSingleton('customer/session')->getCustomerGroupId(),
'template' => $this->getTemplate(),
'name' => $this->getNameInLayout()
);
$cacheId = $shortCacheId;

$shortCacheId = array_values($shortCacheId);
$shortCacheId = implode('|', $shortCacheId);
$shortCacheId = md5($shortCacheId);

$cacheId['category_path'] = $this->getCurrenCategoryKey();
$cacheId['short_cache_id'] = $shortCacheId;

return $cacheId;
}

您应该能够覆盖和更新返回的 key 以满足您的目的。

干杯,京东

关于caching - magento https + IE8 提示问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4788562/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com