Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cbb1b41

Browse filesBrowse files
committed
Merge branch '5.0'
* 5.0: Updated the Doctrine cache examples Mention that DoctrineCacheBundle is deprecated
2 parents 745fb92 + 11c6c01 commit cbb1b41
Copy full SHA for cbb1b41

File tree

1 file changed

+23
-14
lines changed
Filter options

1 file changed

+23
-14
lines changed

‎reference/configuration/doctrine.rst

Copy file name to clipboardExpand all lines: reference/configuration/doctrine.rst
+23-14Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -222,26 +222,35 @@ Keep in mind that you can't use both syntaxes at the same time.
222222
Caching Drivers
223223
~~~~~~~~~~~~~~~
224224

225-
The built-in types of caching drivers are: ``array``, ``apc``, ``apcu``,
226-
``memcache``, ``memcached``, ``redis``, ``wincache``, ``zenddata`` and ``xcache``.
227-
There is a special type called ``service`` which lets you define the ID of your
228-
own caching service.
229-
230-
The following example shows an overview of the caching configurations:
225+
Use any of the existing :doc:`Symfony Cache </cache>` pools or define new pools
226+
to cache each of Doctrine ORM elements (queries, results, etc.):
231227

232228
.. code-block:: yaml
233229
230+
# config/packages/prod/doctrine.yaml
231+
framework:
232+
cache:
233+
pools:
234+
doctrine.result_cache_pool:
235+
adapter: cache.app
236+
doctrine.system_cache_pool:
237+
adapter: cache.system
238+
234239
doctrine:
235240
orm:
236-
auto_mapping: true
237-
# each caching driver type defines its own config options
238-
metadata_cache_driver: apc
241+
# ...
242+
metadata_cache_driver:
243+
type: pool
244+
pool: doctrine.system_cache_pool
245+
query_cache_driver:
246+
type: pool
247+
pool: doctrine.system_cache_pool
239248
result_cache_driver:
240-
type: memcache
241-
host: localhost
242-
port: 11211
243-
instance_class: Memcache
244-
# the 'service' type requires to define the 'id' option too
249+
type: pool
250+
pool: doctrine.result_cache_pool
251+
252+
# in addition to Symfony Cache pools, you can also use the
253+
# 'type: service' option to use any service as the cache
245254
query_cache_driver:
246255
type: service
247256
id: App\ORM\MyCacheService

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.