Skip to content

[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

Closed
Closed
Changes from 2 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
147 changes: 147 additions & 0 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~
Expand Down Expand Up @@ -674,6 +688,8 @@ installation.
You can see an example of the usage of this in
:doc:`/doctrine/pdo_session_storage`.

.. _name:

name
....

Expand Down Expand Up @@ -1446,6 +1462,120 @@ 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.

.. note::

The framework bundle ships with multiple adapters: apcu, doctrine, system,
filesystem, psr6, and redis.
Copy link
Member

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


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.
Copy link
Member

Choose a reason for hiding this comment

The 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 cache.doctrine service."


default_psr6_provider
.....................

**type**: ``string`` **default**: ``%kernel.cache_dir%/pools``
Copy link
Member

Choose a reason for hiding this comment

The 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.
Copy link
Member

Choose a reason for hiding this comment

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

Same here: "This is available as cache.psr6 service"


default_redis_provider
......................

**type**: ``string`` **default**: ``redis://localhost``

The dsn to use by the Redis provider.
Copy link
Member

Choose a reason for hiding this comment

The 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.

.. _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
#######
Copy link
Member

Choose a reason for hiding this comment

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

These should be " as well


**type**: ``string`` **default**: ``cache.app``

A cache adapter.
Copy link
Member

Choose a reason for hiding this comment

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

This description should be improved to explain the purpose of this option. Thanks!


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
--------------------------

Expand Down Expand Up @@ -1580,6 +1710,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
Expand Down