-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Cache] Document "framework.cache" nodes #7245
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
single: Doctrine Cache | ||
single: Redis Cache | ||
|
||
.. _component-cache-cache-pools: | ||
|
||
Cache Pools | ||
=========== | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,20 @@ Configuration | |
* :ref:`cache <reference-serializer-cache>` | ||
* :ref:`enable_annotations <reference-serializer-enable_annotations>` | ||
* :ref:`name_converter <reference-serializer-name_converter>` | ||
* :ref:`cache <reference-cache>` | ||
* :ref:`app <reference-cache-app>` | ||
* `system`_ | ||
* `directory`_ | ||
* `default_doctrine_provider`_ | ||
* `default_psr6_provider`_ | ||
* `default_redis_provider`_ | ||
* `pools`_ | ||
* :ref:`name <reference-cache-pools-name>` | ||
* `adapter`_ | ||
* `public`_ | ||
* `default_lifetime`_ | ||
* `provider`_ | ||
* `clearer`_ | ||
|
||
secret | ||
~~~~~~ | ||
|
@@ -674,6 +688,8 @@ installation. | |
You can see an example of the usage of this in | ||
:doc:`/doctrine/pdo_session_storage`. | ||
|
||
.. _name: | ||
|
||
name | ||
.... | ||
|
||
|
@@ -1446,6 +1462,134 @@ value. | |
For more information, see | ||
:ref:`component-serializer-converting-property-names-when-serializing-and-deserializing`. | ||
|
||
.. _reference-cache: | ||
|
||
cache | ||
~~~~~ | ||
|
||
.. _reference-cache-app: | ||
|
||
app | ||
... | ||
|
||
**type**: ``string`` **default**: ``cache.adapter.filesystem`` | ||
|
||
The cache adapter used by the ``cache.app`` service. | ||
|
||
.. tip:: | ||
|
||
It might be tough to understand at the beginning, so to avoid confusion remember that all pools perform the | ||
same actions but on different medium given the adapter they are based on. Internally, a pool wraps the definition | ||
of an adapter. | ||
|
||
.. note:: | ||
|
||
The framework bundle ships with multiple adapters: apcu, doctrine, system, | ||
filesystem, psr6, and redis. | ||
|
||
system | ||
...... | ||
|
||
**type**: ``string`` **default**: ``cache.adapter.system`` | ||
|
||
The cache adapter used by the ``cache.system`` service. | ||
|
||
directory | ||
......... | ||
|
||
**type**: ``string`` **default**: ``%kernel.cache_dir%/pools`` | ||
|
||
The path to the cache directory used by services inheriting from the | ||
``cache.adapter.filesystem`` adapter (including ``cache.app``). | ||
|
||
default_doctrine_provider | ||
......................... | ||
|
||
**type**: ``string`` | ||
|
||
The service name to use as your default Doctrine provider. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add the service name of this "default provider": "This is available as |
||
|
||
default_psr6_provider | ||
..................... | ||
|
||
**type**: ``string`` **default**: ``%kernel.cache_dir%/pools`` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. default should be removed |
||
|
||
The service name to use as your default PSR-6 provider. | ||
8000
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here: "This is available as |
||
|
||
default_redis_provider | ||
...................... | ||
|
||
**type**: ``string`` **default**: ``redis://localhost`` | ||
|
||
The dsn to use by the Redis provider. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ...and here: "This is available as cache.redis service" |
||
|
||
pools | ||
..... | ||
|
||
**type**: ``array`` | ||
|
||
A list of cache pools to be created by the framework extension. | ||
|
||
.. seealso:: | ||
|
||
For more information about how pools works, see :ref:`cache pools <component-cache-cache-pools>`. | ||
|
||
.. _reference-cache-pools-name: | ||
|
||
name | ||
"""" | ||
|
||
**type**: ``prototype`` | ||
|
||
Name of the pool you want to create. | ||
|
||
.. note:: | ||
|
||
Your pool name must differ from ``cache.app`` or ``cache.system``. | ||
|
||
adapter | ||
####### | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be |
||
|
||
**type**: ``string`` **default**: ``cache.app`` | ||
|
||
The name of the adapter to use. You could also use your own implementation. | ||
|
||
.. note:: | ||
|
||
Your service MUST implement the :class:`Psr\\Cache\\CacheItemPoolInterface` interface. | ||
|
||
public | ||
###### | ||
|
||
**type**: ``boolean`` **default**: ``false`` | ||
|
||
Whether your service should be public or not. | ||
|
||
default_lifetime | ||
################ | ||
|
||
**type**: ``integer`` | ||
|
||
Default lifetime of your cache items in seconds. | ||
|
||
provider | ||
######## | ||
|
||
**type**: ``string`` | ||
|
||
The service name to use as provider when the specified adapter needs one. | ||
|
||
clearer | ||
####### | ||
|
||
**type**: ``string`` | ||
|
||
The cache clearer used to clear your PSR-6 cache. | ||
|
||
.. seealso:: | ||
|
||
For more information, see :class:`Symfony\\Component\\HttpKernel\\CacheClearer\\Psr6CacheClearer`. | ||
|
||
Full Default Configuration | ||
-------------------------- | ||
|
||
|
@@ -1580,6 +1724,23 @@ Full Default Configuration | |
file_cache_dir: '%kernel.cache_dir%/annotations' | ||
debug: '%kernel.debug%' | ||
|
||
# cache configuration | ||
cache: | ||
app: cache.app | ||
system: cache.system | ||
directory: '%kernel.cache_dir%/pools' | ||
default_doctrine_provider: ~ | ||
default_psr6_provider: ~ | ||
default_redis_provider: 'redis://localhost' | ||
pools: | ||
# Prototype | ||
name: | ||
adapter: cache.app | ||
public: false | ||
default_lifetime: ~ | ||
provider: ~ | ||
clearer: ~ | ||
|
||
.. _`HTTP Host header attacks`: http://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html | ||
.. _`Security Advisory Blog post`: https://symfony.com/blog/security-releases-symfony-2-0-24-2-1-12-2-2-5-and-2-3-3-released#cve-2013-4752-request-gethost-poisoning | ||
.. _`Doctrine Cache`: http://docs.doctrine-project.org/projects/doctrine-common/en/latest/reference/caching.html | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This note content should be added to the setting description imo