<?php

declare(strict_types=1);

namespace App\Framework\View\Caching\Strategies;

use App\Framework\Cache\CacheKey;
use App\Framework\View\Caching\TemplateContext;

final readonly class NoCacheStrategy implements ViewCacheStrategy
{
    public function shouldCache(TemplateContext $context): bool
    {
        return false;
    }

    public function generateKey(TemplateContext $context): CacheKey
    {
        return CacheKey::fromString('no-cache');
    }

    public function getTtl(TemplateContext $context): int
    {
        return 0;
    }

    public function canInvalidate(string $template): bool
    {
        return false;
    }
}
