inspiredminds/contao-future-cache-invalidation
Composer 安装命令:
composer require inspiredminds/contao-future-cache-invalidation
包简介
Invalidates cache tags in the future for any DCA in Contao that has a `start` or `stop` field.
README 文档
README
Contao Future Cache Invalidation
Invalidates cache tags in the future for any DCA that has a start or stop field.
In Contao 5 you will only need to route the message manually:
# config/config.yaml framework: messenger: routing: 'InspiredMinds\ContaoFutureCacheInvalidation\Message\InvalidateCacheMessage': contao_prio_high
In Contao 4.13 you will also have to create a messenger transport, e.g.:
framework: messenger: transports: cache_invalidation: 'doctrine://default?queue_name=cache_invalidation' routing: 'InspiredMinds\ContaoFutureCacheInvalidation\Message\InvalidateCacheMessage': cache_invalidation
If you use such a doctrine:// transport you will also have to install symfony/doctrine-messenger:
composer require symfony/doctrine-messenger
Then you have to consume the messages somehow via
vendor/bin/contao-console messenger:consume cache_invalidation
e.g. via a crontab entry like this:
* * * * * /usr/bin/php /var/www/example.com/vendor/bin/contao-console messenger:consume cache_invalidation --time-limit=59 --quiet
There is still a caveat: the cache invalidation is based on the contao.db.*.* cache tags. However, this will not
work for the start case, as the cache tag would be missing for that URL. For child elements like articles, content
elements or news (child of a news archive) it will still work as the extension will also invalidate the tags of the
parent. But for pages for example this would not be solved this way - i.e. when you have a start time for page, it
would still not show up in the menu of cached pages. In this case the extension clears the whole cache instead.
Note: as this utilizes the Symfony Messenger with its DelayStamp it will only work for the following messenger
transport types:
doctrineamqpredis
There is also a command with which you can create these future cache invalidation messages for all existing database entries after installation:
vendor/bin/contao-console contao_future_cache_invalidation:create-messages
inspiredminds/contao-future-cache-invalidation 适用场景与选型建议
inspiredminds/contao-future-cache-invalidation 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.24k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 03 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 inspiredminds/contao-future-cache-invalidation 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 inspiredminds/contao-future-cache-invalidation 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2025-03-31