mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Remove segmentation from core caches
This commit is contained in:
parent
0b18090003
commit
dac3c5ee16
2
cache/Cache.php
vendored
2
cache/Cache.php
vendored
@ -192,7 +192,7 @@ class SS_Cache {
|
||||
$frontend, $backend[0], $frontendOptions, $backend[1]
|
||||
);
|
||||
|
||||
if (isset($frontendOptions['disable-container']) && $frontendOptions['disable-container']) {
|
||||
if (isset($frontendOptions['disable-segmentation']) && $frontendOptions['disable-segmentation']) {
|
||||
return $cache;
|
||||
}
|
||||
|
||||
|
@ -118,6 +118,7 @@ class SS_ConfigManifest {
|
||||
'automatic_serialization' => true,
|
||||
'lifetime' => null,
|
||||
'cache_id_prefix' => 'SS_Configuration_',
|
||||
'disable-segmentation' => true,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ class SilverStripeVersionProvider
|
||||
|
||||
$lockData = array();
|
||||
if ($cache) {
|
||||
$cache = SS_Cache::factory('SilverStripeVersionProvider_composerlock');
|
||||
$cache = SS_Cache::factory('SilverStripeVersionProvider_composerlock', 'Output', array('disable-segmentation' => true));
|
||||
$cacheKey = filemtime($composerLockPath);
|
||||
if ($versions = $cache->load($cacheKey)) {
|
||||
$lockData = json_decode($versions, true);
|
||||
|
@ -39,7 +39,7 @@ class GDBackend extends SS_Object implements Image_Backend {
|
||||
// If we're working with image resampling, things could take a while. Bump up the time-limit
|
||||
increase_time_limit_to(300);
|
||||
|
||||
$this->cache = SS_Cache::factory('GDBackend_Manipulations');
|
||||
$this->cache = SS_Cache::factory('GDBackend_Manipulations', 'Output', array('disable-segmentation' => true));
|
||||
|
||||
if($filename && is_readable($filename)) {
|
||||
$this->cacheKey = md5(implode('_', array($filename, filemtime($filename))));
|
||||
|
@ -121,7 +121,15 @@ class i18n extends SS_Object implements TemplateGlobalProvider, Flushable {
|
||||
* @return Zend_Cache
|
||||
*/
|
||||
public static function get_cache() {
|
||||
return SS_Cache::factory('i18n', 'Output', array('lifetime' => null, 'automatic_serialization' => true));
|
||||
return SS_Cache::factory(
|
||||
'i18n',
|
||||
'Output',
|
||||
array(
|
||||
'lifetime' => null,
|
||||
'automatic_serialization' => true,
|
||||
'disable-segmentation' => true,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,7 @@ class CleanImageManipulationCache extends BuildTask {
|
||||
$images = DataObject::get('Image');
|
||||
|
||||
if($images && Image::get_backend() == "GDBackend") {
|
||||
$cache = SS_Cache::factory('GDBackend_Manipulations');
|
||||
$cache = SS_Cache::factory('GDBackend_Manipulations', 'Output', array('disable-segmentation' => true));
|
||||
|
||||
foreach($images as $image) {
|
||||
$path = $image->getFullPath();
|
||||
|
2
tests/cache/CacheTest.php
vendored
2
tests/cache/CacheTest.php
vendored
@ -105,7 +105,7 @@ class CacheTest extends SapphireTest {
|
||||
}
|
||||
|
||||
public function testDisableVersionedCacheSegmentation() {
|
||||
$cacheInstance = SS_Cache::factory('versioned_disabled', 'Output', ['disable-container' => true]);
|
||||
$cacheInstance = SS_Cache::factory('versioned_disabled', 'Output', array('disable-segmentation' => true));
|
||||
$cacheInstance->clean();
|
||||
|
||||
Versioned::set_reading_mode('Stage.Live');
|
||||
|
Loading…
Reference in New Issue
Block a user