Disabling Cache in Silverstripe 3.1

While working with Silverstripe we found ourselves having to run “?flush=1” a lot to clear the Cache. To switch it off, while you work, add the following to your mysite/_config.php:

SS_Cache::set_cache_lifetime('default', -1, 100);


2 thoughts on “Disabling Cache in Silverstripe 3.1

  1. Works on 2.4.13 thank you.

    We are working with subversion and three versions of our code:

    Local = I put this line in my _localConfig.php to kill caching on my local

    Dev (a staging server published to the web)= _localConfig.php is not part of the version control deployment so I created and added this file manually via ftp  This file only contains this line of code, not all my local config code.  Caching is turned off now on our dev.  You’ll have to do one final flush=all to clear out the current contents of the cache.

    Live (the real site) = Live still has caching turned on as _localConfig.php is not part of the deployment.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.