This is the length of time in seconds that a template cache is valid. Once this time has expired, the cache will be regenerated. $caching must be set to "true" for $cache_lifetime to have any purpose. A value of -1 will force the cache to never expire. A value of 0 will cause the cache to always regenerate (good for testing only, to disable caching a more efficient method is to set $caching = false.)
此變數的值是以秒為單位,設定暫存快取檔的有效時間。只要超過此處設定的時間 的話,則快取內容就會被重新產生。$caching 設定為 "true" 的話設定 $cache_lifetime 才有 意義。如果此變數值的內容為-1則是強迫快取永遠不會過期。值為0的話則表示一定會重新製造 快取內容(只有在測試時是好的,關閉快取有效率的方式是將 $caching 設定為 false)
If $force_compile is enabled, the cache files will be regenerated every time, effectively disabling caching. You can clear all the cache files with the clear_all_cache() function, or individual cache files (or groups) with the clear_cache() function.
如果 $force_compile 是開啟的話,則快取檔案一定會被重新製造。你可以使用 clear_all_cache() 函式以清除所有的快取檔案,或是使用 clear_cache() 函式以清除個別或多個快取檔。
Technical Note: If you want to give certain templates their own cache lifetime, you could do this by setting $caching = 2, then set $cache_lifetime to a unique value just before calling display() or fetch().
技術提醒: 如果你想讓某些樣版檔案有他們自己的快取存活時間的話,你可以將 $caching 設定為2,然後在呼叫 display() 或 fetch() 前將某值設定給 $cache_lifetime。