Merge pull request #9682 from silverstripe-terraformers/feature/partial-cache-docs

DOCS: Example of partial cache expiry setting.
This commit is contained in:
Garion Herman 2020-09-16 15:49:50 +12:00 committed by GitHub
commit a712000404
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,6 +169,22 @@ If you have good `$CacheKey` and `$CacheCondition` implementations, you may want
improve performance.
[/note]
Example below shows how to set partial cache expiry to one hour.
```yaml
# app/_config/cache.yml
---
Name: app-cache
After:
- 'corecache'
---
SilverStripe\Core\Injector\Injector:
Psr\SimpleCache\CacheInterface.cacheblock:
constructor:
namespace: "cacheblock"
defaultLifetime: 3600
```
### Nested cached blocks