Skip to content

Commit

Permalink
Merge pull request #1556 from ConductionNL/feature/MF-39/doctrine-in-…
Browse files Browse the repository at this point in the history
…redis

Cache doctrine responses
  • Loading branch information
rjzondervan authored Sep 26, 2023
2 parents 93448b1 + 0fcca80 commit d0bd0f6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ doctrine:
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
metadata_cache_driver:
type: service
id: doctrine.system_cache_provider
query_cache_driver:
type: service
id: doctrine.system_cache_provider
result_cache_driver:
type: service
id: doctrine.result_cache_provider

dql:
string_functions:
regexp_replace: DoctrineExtensions\Query\Postgresql\RegexpReplace
1 change: 1 addition & 0 deletions api/config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ framework:
cache:
prefix_seed: commonground_gateway_cache
app: cache.adapter.redis
system: cache.adapter.redis
default_redis_provider: "redis://%env(REDIS_HOST)%:%env(int:REDIS_PORT)%"
parameters:
samesite: none
Expand Down
9 changes: 9 additions & 0 deletions api/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,12 @@ services:
class: App\Logger\SessionDataProcessor
tags:
- { name: monolog.processor }

doctrine.result_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
arguments:
- '@doctrine.result_cache_pool'
doctrine.system_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
arguments:
- '@doctrine.system_cache_pool'

0 comments on commit d0bd0f6

Please sign in to comment.