Skip to content

Commit

Permalink
Cache doctrine responses
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzondervan committed Sep 26, 2023
1 parent 32bb122 commit a82c344
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 a82c344

Please sign in to comment.