Skip to content

Instantly share code, notes, and snippets.

@svandragt
Created November 20, 2012 11:38
Show Gist options
  • Select an option

  • Save svandragt/4117437 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown
Author

untested!

@svandragt

Copy link
Copy Markdown
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