Skip to content

fix(seo): warn when Cloudflare strips the ETag from a page - #637

Merged
harlan-zw merged 1 commit into
mainfrom
fix/html-etag-production
Oct 13, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/html-etag-production

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Every deploy since #636 fails pnpm production:edge-cache with no-etag. The Worker does send the ETag, but Cloudflare removes it from an HTML 200 while a zone feature that rewrites HTML is on. On skilld.dev, Email Obfuscation, Automatic HTTPS Rewrites and Replace insecure JavaScript libraries are all on. Cloudflare's ETag reference names them as features that remove ETags. A 304 has no body, so it keeps the ETag:

GET /cli                                200, no etag
GET /cli  If-None-Match: *              304, etag: W/"de612440-…-7c8dc9c9…"
GET /cli  If-None-Match: <that etag>    304, cf-cache-status: HIT

When a page arrives without an ETag, the check now asks for a 304 with If-None-Match: * and reads the ETag there. It runs the 304 and stored-page checks with that ETag. A stripped ETag becomes a warning in the result and a GitHub annotation. The deploy still fails when no response carries an ETag, or when a 304 replaces a stored page.

Crawlers still never see the ETag on a 200, so they cannot send it back. That needs a zone change: turn those three features off for skilld.dev, or add a Configuration Rule that turns them off for its HTML. This pull request changes no zone setting.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

Every deploy since #636 failed the edge cache check with `no-etag`. The
Worker sends the ETag, but Cloudflare removes it from an HTML 200 while a
zone feature that rewrites HTML is on, such as Email Obfuscation or
Automatic HTTPS Rewrites. A 304 has no body, so it keeps the ETag.

The check now asks for a 304 with `If-None-Match: *` when the page has no
ETag, reads the ETag there, and runs the 304 and stored-page checks with
it. A stripped ETag becomes a warning and a GitHub annotation. The deploy
still fails when no response carries an ETag, or when a 304 replaces the
stored page.
@harlan-zw harlan-zw added the harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. label Oct 13, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. labels Oct 13, 2026
@harlan-github-agent

harlan-github-agent Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-10-13 10:02 UTC.

GitHub merged this pull request.

No material findings were recorded.

The pull request closed.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Oct 13, 2026
@harlan-zw
harlan-zw merged commit 9f11637 into main Oct 13, 2026
8 checks passed
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant