easytek/doctrine-cache-invalidator-bundle
Cache::tags()) or event listeners may offer more flexible alternatives.Model::getCacheKey()).Observers or Model::dispatch()).Cache::tags()->put()) or event listeners achieve the same goal with less risk?doctrine/orm + laravel-doctrine/orm).postPersist, postUpdate, etc.) via Laravel’s event system.// app/Providers/DoctrineCacheProvider.php
public function register()
{
$this->app->register(EasytekDoctrineCacheInvalidatorBundle::class);
// Override or extend the Bundle’s services for Laravel.
}
config/services.php or environment variables.// app/Services/CacheInvalidation.php
class CacheInvalidation implements CacheInvalidationInterface
{
public function getClasses(): array
{
return [
App\Entity\User::class => [
['cache_id_pattern' => 'user_{id}', 'events' => ['update']],
],
];
}
}
Cache::tags() or queue-based invalidation.{attribute}) may lead to over-invalidation if not carefully defined.getClasses() or invalidation logic could crash entity operations.How can I help you explore Laravel packages today?