【发布时间】:2022-01-23 18:54:50
【问题描述】:
我正在尝试使用 API 平台和 AWS CloudFront 实现 HTTP 缓存失效,正如我在 API Platform documentation 中看到的那样:
通过实现
ApiPlatform\Core\HttpCache\PurgerInterface,可以轻松添加对 Varnish 以外的反向代理的支持
我已经编写了一个实现,但现在我无法制作内置缓存失效系统 - 应该是事件侦听器 ApiPlatform\Core\Bridge\Doctrine\EventListener\PurgeHttpCacheListener- 它只是继续注入 ApiPlatform\Core\HttpCache\VarnishPurger。
我基本上做了什么,config/services.yml - 启用了自动接线:
ApiPlatform\Core\HttpCache\PurgerInterface: '@App\ApiPlatform\HttpCache\CloudFrontPurger'
ApiPlatform\Core\Bridge\Doctrine\EventListener\PurgeHttpCacheListener:
arguments:
$purger: '@App\ApiPlatform\HttpCache\CloudFrontPurger'
有什么想法吗?
【问题讨论】:
标签: amazon-cloudfront api-platform.com http-caching