Skip to content

Commit f865f93

Browse files
committed
[symfony#6947] some minor tweaks
1 parent 152aecc commit f865f93

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

components/cache/cache_invalidation.rst

+14-10
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,22 @@ change in the state of your model. The most basic kind of invalidation is direct
1010
items deletion. But when the state of a primary resource has spread accross
1111
several cached items, keeping them in sync can be difficult.
1212

13-
The Symfony Cache component provides two mechanisms to help solve this problem:
13+
The Symfony Cache component provides two mechanisms to help solving this problem:
1414

15-
* Tags based invalidation for managing data dependencies;
16-
* Expiration based invalidation for time related dependencies.
15+
* :ref:`Tags based invalidation <cache-component-tags>` for managing data dependencies;
16+
* :ref:`Expiration based invalidation <cache-component-expiration>` for time related dependencies.
1717

18-
.. versionadded:: 3.2
19-
Tags based invalidation was introduced in Symfony 3.2.
18+
.. _cache-component-tags:
2019

2120
Using Cache Tags
2221
----------------
2322

23+
.. versionadded:: 3.2
24+
Tags based invalidation was introduced in Symfony 3.2.
25+
2426
To benefit from tags based invalidation, you need to attach the proper tags to
25-
each cached items. Each tag is a plain string identifier that you can use at any
26-
time to trigger the removal of all items that had this tag attached to them.
27+
each cached item. Each tag is a plain string identifier that you can use at any
28+
time to trigger the removal of all items associated with this tag.
2729

2830
To attach tags to cached items, you need to use the
2931
:method:`Symfony\\Component\\Cache\\CacheItem::tag` method that is implemented by
@@ -36,14 +38,14 @@ cache items, as returned by cache adapters::
3638
$item->tag(array('tag_2', 'tag_3'));
3739
$cache->save($item);
3840

39-
If ``$cache`` implements :class:`Symfony\\Component\\Cache\\TagAwareAdapterInterface`,
41+
If ``$cache`` implements :class:`Symfony\\Component\\Cache\\Adapter\\TagAwareAdapterInterface`,
4042
you can invalidate the cached items by calling
41-
:method:`Symfony\\Component\\Cache\\TagAwareAdapterInterface::invalidateTags`::
43+
:method:`Symfony\\Component\\Cache\\Adapter\\TagAwareAdapterInterface::invalidateTags`::
4244

4345
// invalidate all items related to `tag_1` or `tag_3`
4446
$cache->invalidateTags(array('tag_1', 'tag_3'));
4547

46-
// if you know the cache key, you can of course delete directly
48+
// if you know the cache key, you can also delete the item directly
4749
$cache->deleteItem('cache_key');
4850

4951
Using tags invalidation is very useful when tracking cache keys becomes difficult.
@@ -78,6 +80,8 @@ your fronts and have very fast invalidation checks::
7880
new RedisAdapter('redis://localhost')
7981
);
8082

83+
.. _cache-component-expiration:
84+
8185
Using Cache Expiration
8286
----------------------
8387

components/cache/cache_pools.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ See the method's docblock for more options.
113113
PDO & Doctrine DBAL Cache Adapter
114114
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115115

116+
.. versionadded:: 3.2
117+
The PDO & Doctrine DBAL adapter was introduced in Symfony 3.2.
118+
116119
This adapter stores the cached items a SQL database accessed through a PDO or a
117120
Doctrine DBAL connection::
118121

@@ -130,9 +133,6 @@ Doctrine DBAL connection::
130133
$options = array()
131134
);
132135

133-
.. versionadded:: 3.2
134-
The PDO & Doctrine DBAL adapter was introduced in Symfony 3.2.
135-
136136
Chain Cache Adapter
137137
~~~~~~~~~~~~~~~~~~~
138138

0 commit comments

Comments
 (0)