我有一个Symfony应用程序,我想将Redis用作缓存系统。Symfony默认的缓存系统是文件系统缓存。
根据文档,我了解到Symfony有两个命名缓存:cache.app
和cache.system
,因此我使用以下cache.yaml将两者都设置为Redis:
framework:
cache:
# Put the unique name of your app here: the prefix seed
# is used to compute stable namespaces for cache keys.
prefix_seed: myteam/myapp
default_redis_provider: "redis://redis:6379"
# The app cache caches to the filesystem by default.
# Other options include:
# cache.app via Redis
app: cache.adapter.redis
# cache.system also
system: cache.adapter.redis
做完这个步骤后,我加载了一个示例页面并监控了缓存文件夹。我发现尽管在Redis中创建了键,但仍然会在缓存文件夹中创建文件。
我知道Symfony不建议干扰内核在文件缓存中创建的文件,但即使是cache/prod/Containerxxxxx文件夹也被写入。
可能在文件夹中缓存的是什么不属于应用程序或系统?我错过了另一个命名缓存吗?