diff --git a/config/packages/cache.yaml b/config/packages/cache.yaml index c23aecc..4cf42e8 100644 --- a/config/packages/cache.yaml +++ b/config/packages/cache.yaml @@ -12,6 +12,16 @@ framework: stats.cache: adapter: cache.app default_lifetime: 600 + app.cache.events: + adapter: cache.app + default_lifetime: 1800 + app.cache.homepage: + adapter: cache.app + default_lifetime: 300 + doctrine.result_cache_pool: + adapter: cache.app + doctrine.system_cache_pool: + adapter: cache.system when@test: framework: diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index eaebe6b..5c06639 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -47,11 +47,8 @@ when@prod: cache_driver: type: pool pool: doctrine.result_cache_pool - - framework: - cache: - pools: - doctrine.result_cache_pool: - adapter: cache.app - doctrine.system_cache_pool: - adapter: cache.system + short_lived: + lifetime: 300 + cache_driver: + type: pool + pool: doctrine.result_cache_pool diff --git a/src/Entity/Billet.php b/src/Entity/Billet.php index 92cdb86..7eaddae 100644 --- a/src/Entity/Billet.php +++ b/src/Entity/Billet.php @@ -8,6 +8,7 @@ use Symfony\Component\HttpFoundation\File\File; use Vich\UploaderBundle\Mapping\Attribute as Vich; #[ORM\Entity(repositoryClass: BilletRepository::class)] +#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')] #[Vich\Uploadable] class Billet { diff --git a/src/Entity/BilletDesign.php b/src/Entity/BilletDesign.php index 1663a02..99aef90 100644 --- a/src/Entity/BilletDesign.php +++ b/src/Entity/BilletDesign.php @@ -6,6 +6,7 @@ use App\Repository\BilletDesignRepository; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: BilletDesignRepository::class)] +#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')] class BilletDesign { #[ORM\Id] diff --git a/src/Entity/Category.php b/src/Entity/Category.php index 4d82e64..dbbd855 100644 --- a/src/Entity/Category.php +++ b/src/Entity/Category.php @@ -6,6 +6,7 @@ use App\Repository\CategoryRepository; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: CategoryRepository::class)] +#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')] class Category { #[ORM\Id] diff --git a/src/Entity/Event.php b/src/Entity/Event.php index 609cc37..3837f37 100644 --- a/src/Entity/Event.php +++ b/src/Entity/Event.php @@ -8,6 +8,7 @@ use Symfony\Component\HttpFoundation\File\File; use Vich\UploaderBundle\Mapping\Attribute as Vich; #[ORM\Entity(repositoryClass: EventRepository::class)] +#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')] #[Vich\Uploadable] class Event { diff --git a/src/Entity/User.php b/src/Entity/User.php index 5bf08bb..c68aa23 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -13,6 +13,7 @@ use Vich\UploaderBundle\Mapping\Attribute as Vich; #[ORM\Entity(repositoryClass: UserRepository::class)] #[ORM\Table(name: '`user`')] +#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')] #[UniqueEntity(fields: ['email'], message: 'Un compte existe déjà avec cet email.')] #[Vich\Uploadable] class User implements UserInterface, PasswordAuthenticatedUserInterface