Skip to content

Commit c3d11cf

Browse files
committed
tweak the cache docs
1 parent 21fbded commit c3d11cf

13 files changed

+31
-52
lines changed

cache.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,19 @@ will create pools with service IDs that follow the pattern ``cache.[type]``.
156156
>
157157
<framework:config>
158158
<!--
159-
default_doctrine_dbal_provider: Service: cache.doctrine_dbal
160-
default_psr6_provider: Service: cache.psr6
161-
default_redis_provider: Service: cache.redis
162-
default_memcached_provider: Service: cache.memcached
163-
default_pdo_provider: Service: cache.pdo
159+
default-doctrine-dbal-provider: Service: cache.doctrine_dbal
160+
default-psr6-provider: Service: cache.psr6
161+
default-redis-provider: Service: cache.redis
162+
default-memcached-provider: Service: cache.memcached
163+
default-pdo-provider: Service: cache.pdo
164164
-->
165165
<!-- "directory" attribute is only used with cache.adapter.filesystem -->
166166
<framework:cache directory="%kernel.cache_dir%/pools"
167-
default_doctrine_dbal_provider="doctrine.dbal.default_connection"
168-
default_psr6_provider="app.my_psr6_service"
169-
default_redis_provider="redis://localhost"
170-
default_memcached_provider="memcached://localhost"
171-
default_pdo_provider="pgsql:host=localhost"
167+
default-doctrine-dbal-provider="doctrine.dbal.default_connection"
168+
default-psr6-provider="app.my_psr6_service"
169+
default-redis-provider="redis://localhost"
170+
default-memcached-provider="memcached://localhost"
171+
default-pdo-provider="pgsql:host=localhost"
172172
/>
173173
</framework:config>
174174
</container>

components/cache/adapters/apcu_adapter.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _apcu-adapter:
2-
31
APCu Cache Adapter
42
==================
53

components/cache/adapters/chain_adapter.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _component-cache-chain-adapter:
2-
31
Chain Cache Adapter
42
===================
53

components/cache/adapters/couchbasebucket_adapter.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _couchbase-adapter:
2-
31
Couchbase Bucket Cache Adapter
42
==============================
53

@@ -8,8 +6,8 @@ Couchbase Bucket Cache Adapter
86
The Couchbase Bucket adapter was introduced in Symfony 5.1.
97

108
This adapter stores the values in-memory using one (or more) `Couchbase server`_
11-
instances. Unlike the :ref:`APCu adapter <apcu-adapter>`, and similarly to the
12-
:ref:`Memcached adapter <memcached-adapter>`, it is not limited to the current server's
9+
instances. Unlike the :doc:`APCu adapter </components/cache/adapters/apcu_adapter>`, and similarly to the
10+
:doc:`Memcached adapter </components/cache/adapters/memcached_adapter>`, it is not limited to the current server's
1311
shared memory; you can store contents independent of your PHP environment.
1412
The ability to utilize a cluster of servers to provide redundancy and/or fail-over
1513
is also available.

components/cache/adapters/couchbasecollection_adapter.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _couchbase-collection-adapter:
2-
31
Couchbase Collection Cache Adapter
42
==================================
53

@@ -8,8 +6,8 @@ Couchbase Collection Cache Adapter
86
The Couchbase Collection adapter was introduced in Symfony 5.4.
97

108
This adapter stores the values in-memory using one (or more) `Couchbase server`_
11-
instances. Unlike the :ref:`APCu adapter <apcu-adapter>`, and similarly to the
12-
:ref:`Memcached adapter <memcached-adapter>`, it is not limited to the current server's
9+
instances. Unlike the :doc:`APCu adapter </components/cache/adapters/apcu_adapter>`, and similarly to the
10+
:doc:`Memcached adapter </components/cache/adapters/memcached_adapter>`, it is not limited to the current server's
1311
shared memory; you can store contents independent of your PHP environment.
1412
The ability to utilize a cluster of servers to provide redundancy and/or fail-over
1513
is also available.

components/cache/adapters/doctrine_adapter.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _doctrine-adapter:
2-
31
Doctrine Cache Adapter
42
======================
53

components/cache/adapters/doctrine_dbal_adapter.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _doctrine-dbal-adapter:
2-
31
Doctrine DBAL Cache Adapter
42
===========================
53

components/cache/adapters/filesystem_adapter.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
.. _component-cache-filesystem-adapter:
2-
31
Filesystem Cache Adapter
42
========================
53

64
This adapter offers improved application performance for those who cannot install
7-
tools like :ref:`APCu <apcu-adapter>` or :ref:`Redis <redis-adapter>` in their
5+
tools like :doc:`APCu </components/cache/adapters/apcu_adapter>` or :doc:`Redis </components/cache/adapters/redis_adapter>` in their
86
environment. It stores the cache item expiration and content as regular files in
97
a collection of directories on a locally mounted filesystem.
108

@@ -39,9 +37,10 @@ and cache root path as constructor parameters::
3937

4038
The overhead of filesystem IO often makes this adapter one of the *slower*
4139
choices. If throughput is paramount, the in-memory adapters
42-
(:ref:`Apcu <apcu-adapter>`, :ref:`Memcached <memcached-adapter>`, and
43-
:ref:`Redis <redis-adapter>`) or the database adapters
44-
(:ref:`Doctrine DBAL <doctrine-dbal-adapter>`, :ref:`PDO <pdo-adapter>`) are recommended.
40+
(:doc:`Apcu </components/cache/adapters/apcu_adapter>`, :doc:`Memcached </components/cache/adapters/memcached_adapter>`,
41+
and :doc:`Redis </components/cache/adapters/redis_adapter>`) or the database adapters
42+
(:doc:`Doctrine DBAL </components/cache/adapters/doctrine_dbal_adapter>`, :doc:`PDO </components/cache/adapters/pdo_adapter>`)
43+
are recommended.
4544

4645
.. note::
4746

components/cache/adapters/memcached_adapter.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
.. _memcached-adapter:
2-
31
Memcached Cache Adapter
42
=======================
53

64
This adapter stores the values in-memory using one (or more) `Memcached server`_
7-
instances. Unlike the :ref:`APCu adapter <apcu-adapter>`, and similarly to the
8-
:ref:`Redis adapter <redis-adapter>`, it is not limited to the current server's
5+
instances. Unlike the :doc:`APCu adapter </components/cache/adapters/apcu_adapter>`, and similarly to the
6+
:doc:`Redis adapter </components/cache/adapters/redis_adapter>`, it is not limited to the current server's
97
shared memory; you can store contents independent of your PHP environment.
108
The ability to utilize a cluster of servers to provide redundancy and/or fail-over
119
is also available.

components/cache/adapters/pdo_adapter.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _pdo-adapter:
2-
31
PDO Cache Adapter
42
=================
53

components/cache/adapters/php_files_adapter.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
.. _component-cache-files-adapter:
2-
31
PHP Files Cache Adapter
42
=======================
53

6-
Similarly to :ref:`Filesystem Adapter <component-cache-filesystem-adapter>`, this cache
4+
Similarly to :doc:`Filesystem Adapter </components/cache/adapters/filesystem_adapter>`, this cache
75
implementation writes cache entries out to disk, but unlike the Filesystem cache adapter,
86
the PHP Files cache adapter writes and reads back these cache files *as native PHP code*.
97
For example, caching the value ``['my', 'cached', 'array']`` will write out a cache

components/cache/adapters/redis_adapter.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _redis-adapter:
2-
31
Redis Cache Adapter
42
===================
53

@@ -12,8 +10,8 @@ Redis Cache Adapter
1210

1311
This adapter stores the values in-memory using one (or more) `Redis server`_ instances.
1412

15-
Unlike the :ref:`APCu adapter <apcu-adapter>`, and similarly to the
16-
:ref:`Memcached adapter <memcached-adapter>`, it is not limited to the current server's
13+
Unlike the :doc:`APCu adapter </components/cache/adapters/apcu_adapter>`, and similarly to the
14+
:doc:`Memcached adapter </components/cache/adapters/memcached_adapter>`, it is not limited to the current server's
1715
shared memory; you can store contents independent of your PHP environment. The ability
1816
to utilize a cluster of servers to provide redundancy and/or fail-over is also available.
1917

components/cache/cache_pools.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Pruning Cache Items
192192
-------------------
193193

194194
Some cache pools do not include an automated mechanism for pruning expired cache items.
195-
For example, the :ref:`FilesystemAdapter <component-cache-filesystem-adapter>` cache
195+
For example, the :doc:`FilesystemAdapter </components/cache/adapters/filesystem_adapter>` cache
196196
does not remove expired cache items *until an item is explicitly requested and determined to
197197
be expired*, for example, via a call to ``Psr\Cache\CacheItemPoolInterface::getItem``.
198198
Under certain workloads, this can cause stale cache entries to persist well past their
@@ -202,11 +202,11 @@ expired cache items.
202202
This shortcoming has been solved through the introduction of
203203
:class:`Symfony\\Component\\Cache\\PruneableInterface`, which defines the abstract method
204204
:method:`Symfony\\Component\\Cache\\PruneableInterface::prune`. The
205-
:ref:`ChainAdapter <component-cache-chain-adapter>`,
206-
:ref:`DoctrineDbalAdapter <doctrine-dbal-adapter>`, and
207-
:ref:`FilesystemAdapter <component-cache-filesystem-adapter>`,
208-
:ref:`PdoAdapter <pdo-adapter>`, and
209-
:ref:`PhpFilesAdapter <component-cache-files-adapter>` all implement this new interface,
205+
:doc:`ChainAdapter </components/cache/adapters/chain_adapter>`,
206+
:doc:`DoctrineDbalAdapter </components/cache/adapters/doctrine_dbal_adapter>`, and
207+
:doc:`FilesystemAdapter </components/cache/adapters/filesystem_adapter>`,
208+
:doc:`PdoAdapter </components/cache/adapters/pdo_adapter>`, and
209+
:doc:`PhpFilesAdapter </components/cache/adapters/php_files_adapter>` all implement this new interface,
210210
allowing manual removal of stale cache items::
211211

212212
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
@@ -215,7 +215,7 @@ allowing manual removal of stale cache items::
215215
// ... do some set and get operations
216216
$cache->prune();
217217

218-
The :ref:`ChainAdapter <component-cache-chain-adapter>` implementation does not directly
218+
The :doc:`ChainAdapter </components/cache/adapters/chain_adapter>` implementation does not directly
219219
contain any pruning logic itself. Instead, when calling the chain adapter's
220220
:method:`Symfony\\Component\\Cache\\Adapter\\ChainAdapter::prune` method, the call is delegated to all
221221
its compatible cache adapters (and those that do not implement ``PruneableInterface`` are

0 commit comments

Comments
 (0)