mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-06 01:31:22 +02:00
Add upgrade docs
This commit is contained in:
parent
7ca95b66d8
commit
96701b8ea0
26
docs/en/04_Changelogs/3.7.0.md
Normal file
26
docs/en/04_Changelogs/3.7.0.md
Normal file
@ -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));
|
||||
```
|
Loading…
Reference in New Issue
Block a user