diff --git a/docs/en/02_Developer_Guides/08_Performance/01_Caching.md b/docs/en/02_Developer_Guides/08_Performance/01_Caching.md index ca76d60da..1a680d0ae 100644 --- a/docs/en/02_Developer_Guides/08_Performance/01_Caching.md +++ b/docs/en/02_Developer_Guides/08_Performance/01_Caching.md @@ -90,6 +90,20 @@ e.g. by including the `LastEdited` value when caching `DataObject` results. // set all caches to 3 hours SS_Cache::set_cache_lifetime('any', 60*60*3); +### Versioned cache segmentation + +`SS_Cache` segments caches based on the versioned reading mode. This prevents developers +from caching draft data and then accidentally exposing it on the live stage without potentially +required authorisation checks. This segmentation is automatic for all caches generated using +`SS_Cache::factory` method. + +Data that is not content sensitive can be cached across stages by simply opting out of the +segmented cache with the `disable-segmentation` argument. + +```php +$cache = SS_Cache::factory('myapp', 'Output', array('disable-segmentation' => true)); +``` + ## Alternative Cache Backends By default, SilverStripe uses a file-based caching backend. diff --git a/docs/en/04_Changelogs/3.7.0.md b/docs/en/04_Changelogs/3.7.0.md index 244965f60..6dc129cd6 100644 --- a/docs/en/04_Changelogs/3.7.0.md +++ b/docs/en/04_Changelogs/3.7.0.md @@ -19,8 +19,8 @@ $cache->save('Some draft content. Not for public viewing yet.', 'my_key'); Versioned::set_reading_mode('Stage.Live'); $cache->load('my_key'); // null ``` -Data that is not content sensitive can be cached across stages by simply opting out of the segmented cache with the `disable-container` argument. +Data that is not content sensitive can be cached across stages by simply opting out of the segmented cache with the `disable-segmentation` argument. ```php -$cache = SS_Cache::factory('myapp', 'Output', array('disable-container' => true)); -``` \ No newline at end of file +$cache = SS_Cache::factory('myapp', 'Output', array('disable-segmentation' => true)); +```