Message of the day:
Latest 3.x release: 3.7.1 - it runs on php 7! This is the channel for any SS3-related questions
Backend discussions on SilverStripe 3. For version 4 or newer, see #C36U3BDHN|ss4 or #C0QSDASKT|general. If you are using a version lower than SS3.4, please state, because it makes a difference!
Be careful using
$List('SiteTree') as your identifier for caching. On larger websites that have 100's / 1000's of pages and custom code which auto-saves pages etc you will find that this cache is being regenerated too often and not actually providing any benefit.
I prefer to write a cache key function that actually only updates navigation cache on items that have "Show in menu" ticked.
If you want to get really advance, you can add navigation layer caching in which it caches each parent of the navigation as well and only invalidates cache of the changed pages parents (all the way up). This is handy on large websites that have many pages in navigation as it will re-use the cache layers to regenerate the main navigation cache which is much faster.