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

Add documentation about RedisTagAwareAdapter#14081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
OskarStark merged 1 commit intosymfony:4.4froml-vo:add_redis_tag_aware_4.4
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletionscomponents/cache/adapters/redis_adapter.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -188,6 +188,20 @@ Available Options
When using the `Predis`_ library some additional Predis-specific options are available.
Reference the `Predis Connection Parameters`_ documentation for more information.

.. _redis-tag-aware:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
.. _redis-tag-aware:
.. _redis-tag-aware-adapter:


Working with Tags
-----------------

In order to use tag-based invalidation, you can wrap your adapter in :class:`Symfony\\Component\\Cache\\Adapter\\TagAwareAdapter`, but when Redis is used as backend, it's often more interesting to use the dedicated :class:`Symfony\\Component\\Cache\\Adapter\\RedisTagAwareAdapter`. Since tag invalidation logic is implemented in Redis itself, this adapter offers better performance when using tag-based invalidation::

use Symfony\Component\Cache\Adapter\RedisAdapter;
use Symfony\Component\Cache\Adapter\RedisTagAwareAdapter;

$client = RedisAdapter::createConnection('redis://localhost');
$cache = new RedisTagAwareAdapter($client);


.. _`Data Source Name (DSN)`: https://en.wikipedia.org/wiki/Data_source_name
.. _`Redis server`: https://redis.io/
.. _`Redis`: https://github.com/phpredis/phpredis
Expand Down
4 changes: 4 additions & 0 deletionscomponents/cache/cache_invalidation.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,6 +58,10 @@ To store tags, you need to wrap a cache adapter with the
:method:`Symfony\\Component\\Cache\\Adapter\\TagAwareAdapterInterface::invalidateTags`
method.

.. note::

When using a Redis backend, consider using :ref:`RedisTagAwareAdapter <redis-tag-aware>` which is optimized for this purpose.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
When using a Redis backend, consider using:ref:`RedisTagAwareAdapter<redis-tag-aware>` which is optimized for this purpose.
When using a Redis backend, consider using:ref:`RedisTagAwareAdapter<redis-tag-aware-adapter>`
which is optimized for this purpose.


The :class:`Symfony\\Component\\Cache\\Adapter\\TagAwareAdapter` class implements
instantaneous invalidation (time complexity is ``O(N)`` where ``N`` is the number
of invalidated tags). It needs one or two cache adapters: the first required
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp