Merge pull request #2180 from open-sausages/pulls/3/versioned-cache-segmentation

ENHANCEMENT: Remove segmentation from core caches
This commit is contained in:
Damian Mooyman 2018-06-05 14:02:40 +12:00 committed by GitHub
commit a3a0e9cb1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -441,7 +441,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
foreach($classes as $class) $cacheCanCreate[$class] = singleton($class)->canCreate();
// Generate basic cache key. Too complex to encompass all variations
$cache = SS_Cache::factory('CMSMain_SiteTreeHints');
$cache = SS_Cache::factory('CMSMain_SiteTreeHints', 'Output', array('disable-segmentation' => true));
$cacheKey = md5(implode('_', array(Member::currentUserID(), implode(',', $cacheCanCreate), implode(',', $classes))));
if($this->getRequest()->getVar('flush')) $cache->clean(Zend_Cache::CLEANING_MODE_ALL);
$json = $cache->load($cacheKey);

View File

@ -22,7 +22,7 @@ class CMSMainTest extends FunctionalTest {
}
function testSiteTreeHints() {
$cache = SS_Cache::factory('CMSMain_SiteTreeHints');
$cache = SS_Cache::factory('CMSMain_SiteTreeHints', 'Output', array('disable-segmentation' => true));
// Login as user with root creation privileges
$user = $this->objFromFixture('Member', 'rootedituser');
$user->logIn();