ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

lecms在使用redis中设置他缓存时间

2026/8/14 20:32:04 拓冰建站 浏览量
lecms在使用redis中设置他缓存时间

lecms在使用redis中设置他缓存时间,默认的都是永久缓存,如果数据过大,会导致内存损耗太严重,所以要修改他缓存时间,比如我设置为缓存24个小时,即为86400秒

第一步:找到lecms/xiunophp/cache/cache_redis.class.php  

找到

public function set($k, $s, $life = 0) {

  把$life=0改为86400,注意这个文件有好几处的$life=0都改为86400

image

 第二步:lecms/model/runtime_model.class.php   

找到:

public function set($k, $s, $life = 0) {

  改为86400

image

 

第三步:lecms/model/kv_model.class.php

public function set($k, $s, $life = 0) {

 改为86400 

image