DOCS How to increase partial cache expiry

Closes #3649
This commit is contained in:
Jonathon Menz 2016-10-13 09:37:52 -07:00
parent 7aa257594f
commit a893e2aa0f
1 changed files with 13 additions and 0 deletions

View File

@ -236,3 +236,16 @@ Can be re-written as:
<% end_cached %>
<% end_cached %>
## Cache expiry
The default expiry for partial caches is 10 minutes. The advantage of a short cache expiry is that if you have a problem
with your caching logic, the window in which stale content may be shown is short. The disadvantage, particularly for
low-traffic sites, is that cache blocks may expire before they can be utilised. If you're confident that you're caching
logic is sound, you could increase the expiry dramatically.
**mysite/_config.php**
:::php
// Set partial cache expiry to 7 days
SS_Cache::set_cache_lifetime('cacheblock', 60 * 60 * 24 * 7);