fix(site): clean URL HTML 不再被边缘缓存#79
Merged
Merged
Conversation
之前不缓存规则是 /*.html,只匹配 .html 结尾路径;但 Cloudflare 服务的是 clean URL(/、/skills/x、/en/x,不带 .html),这些 HTML 没拿到 no-cache 头 → 被边缘缓存 → 部署后用户仍看到旧内容(如刚加的 aiOlaOla CTA 不显示)。 改为:/* 默认 max-age=0 must-revalidate(覆盖所有 clean URL HTML);带版本 号的 styles.css/app.js 与 /assets/* 由更具体规则覆盖为长缓存 immutable。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
no-cache 规则从 /.html 改到 /,覆盖 clean URL(无 .html);版本化资源仍长缓存。修复部署后看到旧内容。