Skip to content

Commit

Permalink
Removed "MAGE" cache tag (OpenMage#3246)
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano authored May 13, 2023
1 parent 1f22ced commit 0e8319c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/Resource/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function _generateCache()
Mage::app()->saveCache(
Mage::helper('core')->jsonEncode($data),
self::CACHE_ID,
[Mage_Core_Model_App::CACHE_TAG]
[Mage_Core_Model_Resource_Db_Collection_Abstract::CACHE_TAG]
);
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/Resource/Variable.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function _generateCache()
Mage::app()->saveCache(
Mage::helper('core')->jsonEncode($data),
self::CACHE_ID,
[Mage_Core_Model_App::CACHE_TAG]
[Mage_Core_Model_Resource_Db_Collection_Abstract::CACHE_TAG]
);
}

Expand Down
6 changes: 0 additions & 6 deletions app/code/core/Mage/Core/Model/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ class Mage_Core_Model_App

public const DISTRO_LOCALE_CODE = 'en_US';

/**
* Cache tag for all cache data exclude config cache
*
*/
public const CACHE_TAG = 'MAGE';

/**
* Default store Id (for install)
*/
Expand Down
9 changes: 1 addition & 8 deletions app/code/core/Mage/Core/Model/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,6 @@ public function save($data, $id, $tags = [], $lifeTime = null)
return true;
}

/**
* Add global magento cache tag to all cached data exclude config cache
*/
if (!in_array(Mage_Core_Model_Config::CACHE_TAG, $tags)) {
$tags[] = Mage_Core_Model_App::CACHE_TAG;
}
return $this->getFrontend()->save((string)$data, $this->_id($id), $this->_tags($tags), $lifeTime);
}

Expand Down Expand Up @@ -427,8 +421,7 @@ public function clean($tags = [])
}
$res = $this->getFrontend()->clean($mode, $this->_tags($tags));
} else {
$res = $this->getFrontend()->clean($mode, [Mage_Core_Model_App::CACHE_TAG]);
$res = $res && $this->getFrontend()->clean($mode, [Mage_Core_Model_Config::CACHE_TAG]);
$this->flush();
}
return $res;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ protected function _saveCache($data, $select)
protected function _getCacheTags()
{
$tags = parent::_getCacheTags();
$tags[] = Mage_Core_Model_App::CACHE_TAG;
$tags[] = self::CACHE_TAG;
return $tags;
}
Expand Down

0 comments on commit 0e8319c

Please sign in to comment.