Skip to content

Instantly share code, notes, and snippets.

@svandragt
Created November 20, 2012 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svandragt/4117437 to your computer and use it in GitHub Desktop.
Save svandragt/4117437 to your computer and use it in GitHub Desktop.
How to cache silverstripe menu's for live environment
// limit caching to test + live environment and "Published stage" only
if (Director::isDev() || Versioned::current_stage() !== 'Live') SS_Cache::set_cache_lifetime('any', -1, 100);
<% cached 'navigation', List(Page).max(LastEdited) %>
Menus
<% end_cached %>
@svandragt
Copy link
Author

untested!

@svandragt
Copy link
Author

Yes confirm this is a fix to the problem where draft content gets cached into the live site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment