Closed neildaniels closed 4 years ago
all kirby options must be complete arrays. sadly there is no auto-magical merging. so for the pages cache its just like the readme states:
site/config/config.php with callbacks
return [ 'cache' => [ 'pages' => [ 'active' => true, 'type' => 'redis', // <!-- this will trigger the plugin to be used 'host' => function() { return env('REDIS_HOST'); }, // <--- in array but not from plugin option, since plugin is used a callback will work. 'port' => function() { return env('REDIS_PORT'); }, 'database' => function() { return env('REDIS_DATABASE'); }, 'password' => function() { return env('REDIS_PASSWORD'); }, 'prefix' => 'pages', 'ignore' => function ($page) { return $page->id() === 'something'; } ] ], ];
@neildaniels i think there is also the merging order to be considered. currently the plugin will apply the plugin options first as default and merge the actual settings on top of this.
https://github.com/bnomei/kirby3-redis-cachedriver/blob/master/classes/Redis.php#L25
this is necessary so different caches could use different options. i do not think there is a way to support this and fix the issue you experienced both at the same time.
non the less i will check props again asap. so i am leaving this issue open again in the meantime.
found the issue. will fix today.
I'm trying to set a different default Redis hostname, but I get an error saying "Connection refused" and shows the default (unchanged) hostname. Similar issue with port.
config.php
Current workaround is to simply specify the host in the specific cache: