Open
Description
Description
I couldn't figure out a way to configure a custom marshaller service in per cache pool configuration in the framework bundle. So I can configure an encrypting or compressing marshaller per cache pool.
It is documented how to overwrite the marshaller service but then that's used for all cache pools.
If it's already possible, may we should improve the documentation how to do this.
Example
# config/packages/cache.yaml
framework:
cache:
pools:
local_cache:
adapter: apcu
marshaller: '@app.cache.compressing_marshaller'
token_cache:
adapter: cache.adapter.redis
marshaller: '@app.cache.encrypting_marshaller'
services:
app.cache.encrypting_marshaller:
class: Symfony\Component\Cache\Marshaller\SodiumMarshaller
arguments:
- ['%env(base64:CACHE_DECRYPTION_KEY)%']
# use multiple keys in order to rotate them
#- ['%env(base64:CACHE_DECRYPTION_KEY)%', '%env(base64:OLD_CACHE_DECRYPTION_KEY)%']
- '@cache.default_marshaller'
app.cache.compressing_marshaller:
class: Symfony\Component\Cache\Marshaller\DeflateMarshaller
arguments:
- '@cache.default_marshaller'