$tags Tags for grouping/invalidation * @param int|null $ttl Time-to-live in seconds (null = default, 0 = indefinite) * @return bool True if stored successfully */ public function setWithTags(string $key, mixed $value, CacheScope $scope, string $usage, array $tags, ?int $ttl = null): bool; /** * Invalidate all entries with a specific tag * * @param string $tag Tag to invalidate * @param CacheScope $scope Cache scope level * @param string $usage Usage/bucket name * @return int Number of entries invalidated */ public function invalidateByTag(string $tag, CacheScope $scope, string $usage): int; /** * Get the version/timestamp of a cached entry * * @param string $key Cache key * @param CacheScope $scope Cache scope level * @param string $usage Usage/bucket name * @return int|null Timestamp when entry was cached, or null if not found */ public function getVersion(string $key, CacheScope $scope, string $usage): ?int; /** * Check if an entry is stale based on a reference timestamp * * @param string $key Cache key * @param CacheScope $scope Cache scope level * @param string $usage Usage/bucket name * @param int $reference Reference timestamp to compare against * @return bool True if entry is older than reference (or doesn't exist) */ public function isStale(string $key, CacheScope $scope, string $usage, int $reference): bool; }