Jump to:

21288 Posts in 5733 Topics by 2602 members

General Questions

SilverStripe Forums » General Questions » Why cache draft content?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 133 Views
  • svandragt
    Avatar
    Community Member
    24 Posts

    Why cache draft content? Link to this post

    What reasons are there for caching draft content by default?

    I'm asking this because I've added the following code to mysite/_config.php to restrict caching directives:

    // 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);
    }

    It makes sense to me to have that as a default for SilverStripe in general, because this prevents draft caches from showing on the live site by mistake. I've had this happen with draft menu links for example. It seems a more sensible default from my understanding.

    Why would it be desirable to have caching enabled in draft stages?

    133 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.