@@ -1952,6 +1952,57 @@ A list of cache pools to be created by the framework extension.
1952
1952
1953
1953
For more information about how pools works, see :ref: `cache pools <component-cache-cache-pools >`.
1954
1954
1955
+ To configure a Redis cache pool with a default lifetime of 1 hour, do the following:
1956
+
1957
+ .. configuration-block ::
1958
+
1959
+ .. code-block :: yaml
1960
+
1961
+ # config/packages/framework.yaml
1962
+ framework :
1963
+ cache :
1964
+ pools :
1965
+ cache.mycache :
1966
+ adapter : cache.adapter.redis
1967
+ default_lifetime : 3600
1968
+
1969
+ .. code-block :: xml
1970
+
1971
+ <!-- config/packages/framework.xml -->
1972
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
1973
+ <container xmlns =" http://symfony.com/schema/dic/services"
1974
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
1975
+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
1976
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
1977
+ http://symfony.com/schema/dic/services/services-1.0.xsd
1978
+ http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
1979
+
1980
+ <framework : config >
1981
+ <framework : cache >
1982
+ <framework : pool
1983
+ name =" cache.mycache"
1984
+ adapter =" cache.adapter.redis"
1985
+ default-lifetime =3600
1986
+ />
1987
+ </framework : cache >
1988
+ <!-- ... -->
1989
+ </framework : config >
1990
+ </container >
1991
+
1992
+ .. code-block :: php
1993
+
1994
+ // config/packages/framework.php
1995
+ $container->loadFromExtension('framework', array(
1996
+ 'cache' => array(
1997
+ 'pools' => array(
1998
+ 'cache.mycache' => array(
1999
+ 'adapter' => 'cache.adapter.redis',
2000
+ 'default_lifetime' => 3600,
2001
+ ),
2002
+ ),
2003
+ ),
2004
+ ));
2005
+
1955
2006
.. _reference-cache-pools-name :
1956
2007
1957
2008
name
@@ -1970,7 +2021,10 @@ adapter
1970
2021
1971
2022
**type **: ``string `` **default **: ``cache.app ``
1972
2023
1973
- The name of the adapter to use. You could also use your own implementation.
2024
+ The service name of the adapter to use. You can specify one of the default
2025
+ services that follow the pattern ``cache.adapter.[type] ``. Alternatively you
2026
+ can specify another cache pool as base, which will make this pool inherit the
2027
+ settings from the base pool as defaults.
1974
2028
1975
2029
.. note ::
1976
2030
@@ -1995,7 +2049,10 @@ provider
1995
2049
1996
2050
**type **: ``string ``
1997
2051
1998
- The service name to use as provider when the specified adapter needs one.
2052
+ Overwrite the default service name or DSN respectively, if you do not want to
2053
+ use what is configured as ``default_X_provider `` under ``cache ``. See the
2054
+ description of the default provider setting above for the type of adapter
2055
+ you use for information on how to specify the provider.
1999
2056
2000
2057
clearer
2001
2058
"""""""
0 commit comments