Drupal8设置redis键TTL
我一直在尝试从Drupal内部设置Redis键的TTL,但它似乎不起作用。我们的settings.php如下所示:Drupal8设置redis键TTL,redis,drupal-8,Redis,Drupal 8,我一直在尝试从Drupal内部设置Redis键的TTL,但它似乎不起作用。我们的settings.php如下所示: // Set Redis as the default backend for any cache bin not otherwise specified. $settings['cache']['default'] = 'cache.backend.redis'; $settings['redis.connection']['interface'] = 'PhpRedis
// Set Redis as the default backend for any cache bin not otherwise specified.
$settings['cache']['default'] = 'cache.backend.redis';
$settings['redis.connection']['interface'] = 'PhpRedis';
$settings['redis.connection']['host'] = '127.0.0.1';
$settings['redis.connection']['port'] = '6379';
$settings['redis.connection']['base'] = 8; // This is the DB ID.
#$conf['cache_lifetime_redis'] = 21600;
#$settings['redis.settings']['perm_ttl_cache_field'] = "3 months";
$conf['redis_perm_ttl'] = "3 months";
我试过使用
$conf['cache\u lifetime\u redis']=21600代码>,带有$settings['redis.settings']['perm\u ttl\u cache\u field']=“3个月”代码>和$conf['redis\u perm\u ttl']=“3个月”代码>无效。连接REDIS时,TTL仍然设置为1年。还需要做什么才能使这项工作成功?由于是共享环境,因此在服务器级别进行此设置是不可行的 您可以分别为每个键设置TTL。正如参考文献所说:@AminShojaei-不确定这将如何工作。我们有数百万个键,需要从Drupal(php代码)本身注入TTL。