Xiuno BBS 中的几种缓存API

魔王  (UID: 1) 11月前 [复制链接]
帖子链接已复制到剪贴板

839 0
  1. 持久存储,永不过期
kv_set('key1', 'value1');
kv_get('key1');
kv_delete('key1');
  1. 缓存,可以设置过期时间
cache_set('key1', 'value1', 60);
cache_get('key1');
cache_delete('key1');
  1. 持久存储,cache加速
kv_cache_set('key1', 'value1');
kv_cache_get('key1');
kv_cache_delete('key1');
  1. 合并到setting进行存储,持久存储,并且通过cache加速(如果开启cache)
setting_set('key1');
setting_get('key1', 'value1');
setting_delete('key1');
  1. 合并到runtime中进行存储,持久存储,并且通过cache加速(如果开启cache)
runtime_set('key1');
runtime_get('key1', 'value1');
runtime_delete('key1');
已有评论 (0)
    创建新帖