Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitf865f93

Browse files
committed
[#6947] some minor tweaks
1 parent152aecc commitf865f93

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

‎components/cache/cache_invalidation.rst‎

Lines changed: 14 additions & 10 deletions
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 helpsolve this problem:
13+
The Symfony Cache component provides two mechanisms to helpsolving 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 cacheditems. Each tag is a plain string identifier that you can use at any
26-
time to trigger the removal of all itemsthat had this tag attached to them.
27+
each cacheditem. Each tag is a plain string identifier that you can use at any
28+
time to trigger the removal of all itemsassociated 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 canof coursedelete directly
48+
// if you know the cache key, you canalsodelete 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‎

Lines changed: 3 additions & 3 deletions
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)

[8]ページ先頭

©2009-2025 Movatter.jp