diff --git a/src/Icons/config/iconify.php b/src/Icons/config/iconify.php index 91ea2f57d6b..52aa705a887 100644 --- a/src/Icons/config/iconify.php +++ b/src/Icons/config/iconify.php @@ -27,7 +27,7 @@ ->set('.ux_icons.iconify', Iconify::class) ->args([ - service('cache.system'), + service('.ux_icons.cache'), abstract_arg('endpoint'), service('http_client')->nullOnInvalid(), ]) diff --git a/src/Icons/config/services.php b/src/Icons/config/services.php index fa5e7e5606b..537c0cbb892 100644 --- a/src/Icons/config/services.php +++ b/src/Icons/config/services.php @@ -24,10 +24,15 @@ return static function (ContainerConfigurator $container): void { $container->services() + ->set('.ux_icons.cache') + ->parent('cache.system') + ->private() + ->tag('cache.pool') + ->set('.ux_icons.cache_icon_registry', CacheIconRegistry::class) ->args([ service('.ux_icons.chain_registry'), - service('cache.system'), + service('.ux_icons.cache'), ]) ->set('.ux_icons.local_svg_icon_registry', LocalSvgIconRegistry::class) diff --git a/src/Icons/src/Iconify.php b/src/Icons/src/Iconify.php index 892aa6fc18b..564b87f2bd7 100644 --- a/src/Icons/src/Iconify.php +++ b/src/Icons/src/Iconify.php @@ -196,7 +196,7 @@ public function chunk(string $prefix, array $names): iterable private function sets(): \ArrayObject { - return $this->sets ??= $this->cache->get('ux-iconify-sets', function () { + return $this->sets ??= $this->cache->get('iconify-sets', function () { $response = $this->http->request('GET', '/collections'); return new \ArrayObject($response->toArray()); diff --git a/src/Icons/src/Registry/CacheIconRegistry.php b/src/Icons/src/Registry/CacheIconRegistry.php index 84f633d135f..61497f7965c 100644 --- a/src/Icons/src/Registry/CacheIconRegistry.php +++ b/src/Icons/src/Registry/CacheIconRegistry.php @@ -34,7 +34,7 @@ public function get(string $name, bool $refresh = false): Icon } return $this->cache->get( - \sprintf('ux-icon-%s', Icon::nameToId($name)), + Icon::nameToId($name), fn () => $this->inner->get($name), beta: $refresh ? \INF : null, );