The CMS Squad just rolled out some updates for the Partial Template Caching documentation.
Particularly, we’ve made a separate doc explaining the template tag mechanics in depth and refined the performance recommendations.
Some important new recommendations are:
- Always use cache conditionals whenever possible
- Avoid heavy computations in cache keys and conditionals
- Tune the cache backend settings
- If available, choose a better cache backend than the default (filesystem)
- Depending on how you use cache keys and conditions, consider increasing the cache timeout. (it is 10 minutes by default)
- If using the default cache backend (filesystem), keep an eye on the disk usage (and
inodes). The default filesystem backend does not delete expired cache (backlog: Handle automatic cache purge (avoid capacity overflow) · Issue #6678 · silverstripe/silverstripe-framework · GitHub)
Another recommendation which is not included to the CMS documentation:
- DO NOT cache Elemental Area. Consider caching every separate block instead (where it is appropriate). Especially if you have
silverstripe/userformsinstalled. User data may be leaked through the cache, which is a potential security issue.
If we missed something interesting, please share your recommendations in this thread, or consider making a PR for the CMS documentation: