php - 如何确定学说查询缓存是否在 symfony 应用程序中工作
问题描述
Doctrine 建议在生产环境中打开查询缓存,所以在我的情况prod/doctrine.yaml
下我打开了它:
doctrine:
orm:
auto_generate_proxy_classes: false
metadata_cache_driver:
type: pool
pool: doctrine.system_cache_pool
query_cache_driver:
type: pool
pool: doctrine.system_cache_pool
framework:
cache:
pools:
doctrine.system_cache_pool:
adapter: cache.system
我的cache.system
设置cacge.yaml
是这样的:
framework:
cache:
system: cache.adapter.filesystem
当然,我也添加./bin/console doctrine:cache:clear-query -e prod
到我的部署过程中。但我没有注意到任何速度改进。
现在我的cache.system
适配器使用文件系统。我var/cache/prod
在打开和不打开查询缓存的情况下运行相同的端点后测量大小,看起来缓存大小是一样的,而且缓存的结构也一样。我可以看到它正在生成原则代理和default_metadata.php
文件,但我没有查看与查询缓存相关的任何缓存条目。
有没有办法确定学说查询缓存是否有效?
解决方案
推荐阅读
- prisma - 使用 MongoDB 的 Prisma 中缺少逻辑或
- python - 如何将 URI 转换为字典
- javascript - 无法修改锚元素的 innerHTML
- raspberry-pi - 通过 RTSP 流式传输 H264 时视频帧损坏
- vuejs2 - “Computed”中的 V-For 不显示
- google-cloud-data-fusion - 在 Cloud Data Fusion 中对 BigQuery 执行 MSSQL 时如何修复“java.lang.NullPointerException:null”
- php - 如何从字符串中获取数据
- javascript - 如何解决 Uncaught TypeError: Cannot read property 'length' of undefined of my Global 变量?
- java - 八个随机整数的数组,其中每个整数与数组中所有其他整数的差异至少为 15?
- powerbi - 如何使用 Power BI 切片器筛选表的两列