cache = $cacheFactory->createDistributed('deck-attachments'); } public function getAttachmentCount(int $cardId): ?int { return $this->cache->get('count-' . $cardId); } public function setAttachmentCount(int $cardId, int $count): void { $this->cache->set('count-' . $cardId, $count); } public function clearAttachmentCount(int $cardId): void { $this->cache->remove('count-' . $cardId); } }