Skip to main content

create_cache

Function create_cache 

Source
pub async fn create_cache(
    app_name: &str,
    cache_config: &CacheConfig,
    redis_config: &RedisConfig,
) -> Result<SharedCache>
Expand description

从配置创建共享缓存实例

app_name 将作为所有缓存 key 的前缀("{app_name}:{key}"), 确保多项目共享同一 Redis 时 key 不冲突。 若 app_name 为空则不加前缀。