From 96701b8ea04bf5815072ad3350f7952ad64aed4e Mon Sep 17 00:00:00 2001 From: Aaron Carlino Date: Wed, 30 May 2018 16:24:09 +1200 Subject: [PATCH] Add upgrade docs --- docs/en/04_Changelogs/3.7.0.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 docs/en/04_Changelogs/3.7.0.md diff --git a/docs/en/04_Changelogs/3.7.0.md b/docs/en/04_Changelogs/3.7.0.md new file mode 100644 index 000000000..48a8825b0 --- /dev/null +++ b/docs/en/04_Changelogs/3.7.0.md @@ -0,0 +1,26 @@ +# 3.7.0 + +### Versioned cache segmentation + +The cache API now maintains separate cache pools for each versioned stage. This prevents users from caching draft data and then exposing it on the live stage. + +```php +// Before: +$cache = SS_Cache::factory('myapp'); +Versioned::set_reading_mode('Stage.Live'); +$cache->save('Some draft content. Not for public viewing yet.', 'my_key'); +Versioned::set_reading_mode('Stage.Stage'); +$cache->load('my_key'); // 'Some draft content. Not for public viewing yet' + +// After: +$cache = SS_Cache::factory('myapp'); +Versioned::set_reading_mode('Stage.Live'); +$cache->save('Some draft content. Not for public viewing yet.', 'my_key'); +Versioned::set_reading_mode('Stage.Stage'); +$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. + +```php +$cache = SS_Cache::factory('myapp', 'Output', array('disable-container' => true)); +``` \ No newline at end of file