Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Cloudflare: purges are now queued, paced and retried (template #115)

已关闭 适合新手
#142 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1-3 小时
新手友好度
90/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
markdown
领域
documentation

调研方向

更新 content/6.deployment/6.cloudflare.md(Rate limits、purge 失败日志消息、新的设置表)以及 content/6.deployment/3.ci-cd.md 中的 CDN Purging 表格,使用链接的模板提交 37afcb1 作为新的队列/重试行为和四个 CLOUDFLARE_PURGE_* 变量的事实来源。完成标准是:过时的 ‘no retry’ 说法已移除,四个新日志消息被准确引用,并且两个页面都列出了这些变量及共享账户的建议。

由索引模型根据 Issue 内容生成。

描述

Template commit 37afcb1 (components-web-app#115) changes how the patched Souin sends purges to Cloudflare. Several statements in the docs are now out of date.

What changed

  • Purges are queued in one sender per zone instead of sent straight away. Tags are deduplicated and sent up to 100 per request (previously 30), paced by a token bucket sized for the Cloudflare plan.
  • A 429 is retried after Retry-After. 5xx and network errors are retried too. Other failures, such as a bad token (401/403), are logged and dropped.
  • A backlog that can't be sent within a minute is replaced by one purge everything. A full flush replaces anything queued.
  • New optional settings (php container env; GitLab/GitHub variables reach helm through k8s.sh, and compose passes them through when set):
Variable Default Notes
CLOUDFLARE_PURGE_PLAN free free, pro, business or enterprise: sets the rate and burst to that plan's purge limits
CLOUDFLARE_PURGE_REQUESTS from the plan Requests per CLOUDFLARE_PURGE_WINDOW
CLOUDFLARE_PURGE_WINDOW from the plan A Go duration, e.g. 1m, 1s
CLOUDFLARE_PURGE_BURST from the plan Requests that can be sent at once

Each php process has its own bucket, but the limit is per account. When staging and production, or several sites, share an account, set a lower rate on each (e.g. on Free, CLOUDFLARE_PURGE_REQUESTS=2, CLOUDFLARE_PURGE_BURST=10 for each of two sites). A 429 from a neighbour is still retried, so going over costs a delay, not a stale page.

Limits: the queue is in memory, so a pod crash loses purges still queued (a deploy purges everything anyway). Edge purges can arrive later than the save while the bucket refills.

Pages to update

  • content/6.deployment/6.cloudflare.md
    • Rate limits: "Souin doesn't retry, so each refused purge leaves its pages stale" is no longer true. Describe the queue, the retry and the coalescing into purge everything.
    • The Pro-or-above recommendation can soften: Free no longer loses purges. It still delays them under heavy editing, and coalescing turns them into whole-zone purges, which costs edge hit rate.
    • Purge failures are logged: the messages are now Cloudflare purge of N tags rate limited, will retry in …, … failed with status N, will retry: … (5xx), … failed with status N: … [tags] (dropped), and Cloudflare purge: N tags queued, more than the purge limit can send soon, so purging everything instead.
    • Add the settings above, with the advice for shared accounts.
  • content/6.deployment/3.ci-cd.md, CDN Purging table: add the four variables.
主要语言
Vue
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

components-web-app/docs 的其他 Issue

查看 components-web-app/docs 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。