Skip to content

[codex] add discovery headers#129

Merged
basit3407 merged 2 commits intomainfrom
codex/add-discovery-headers-and-robots
Apr 20, 2026
Merged

[codex] add discovery headers#129
basit3407 merged 2 commits intomainfrom
codex/add-discovery-headers-and-robots

Conversation

@basit3407
Copy link
Copy Markdown
Collaborator

@basit3407 basit3407 commented Apr 20, 2026

What changed

  • add homepage Link discovery headers for machine-readable API descriptions and human-facing documentation entry points
  • add a scoped /robots.txt header rule in static/_headers so the robots asset gets its intended cache policy without inheriting the default HTML cache header
  • keep the change scoped to static/_headers only

Why

The homepage did not advertise useful discovery relations for agents and API consumers. In addition, the existing robots.txt asset on main should be handled through headers only, not re-added in this branch.

Impact

  • GET / will return additional Link relations: describedby, service-desc, and service-doc
  • GET /robots.txt will keep using the existing file from main, with the intended cache behavior from _headers
  • agents and tooling have a clearer machine-readable and human-readable discovery path from the homepage

Root cause

The Cloudflare Pages header configuration did not include discovery Link relations on the homepage, and the robots asset needed a path-specific header override rather than a duplicate file addition.

Validation

  • verified the homepage discovery header payload is 1079 characters, below the Cloudflare Pages 2000-character per-header limit
  • ran local Cloudflare Pages dev and confirmed GET / returns the planned discovery Link header
  • ran local Cloudflare Pages dev and confirmed GET /robots.txt returns 200, Content-Type: text/plain; charset=utf-8, and Cache-Control: public, max-age=86400
  • verified all linked production targets currently return 200
@basit3407 basit3407 marked this pull request as ready for review April 20, 2026 05:34
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 20, 2026

Deploying qf-api-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: d950fb7
Status: ✅  Deploy successful!
Preview URL: https://d369a843.qf-api-docs.pages.dev
Branch Preview URL: https://codex-add-discovery-headers.qf-api-docs.pages.dev

View logs

@basit3407 basit3407 force-pushed the codex/add-discovery-headers-and-robots branch from 89d603e to 40552cd Compare April 20, 2026 05:38
@basit3407 basit3407 changed the title [codex] add discovery headers and robots.txt Apr 20, 2026
@basit3407 basit3407 requested a review from Copilot April 20, 2026 05:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds homepage discovery Link headers to advertise machine-readable API descriptions and human-facing documentation, and scopes /robots.txt caching behavior via Cloudflare Pages _headers.

Changes:

  • Add homepage (/) Link discovery relations (describedby, service-desc, service-doc).
  • Add a path-specific /robots.txt header rule to ensure the intended cache policy is applied.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread static/_headers Outdated
@basit3407 basit3407 merged commit 80a0c76 into main Apr 20, 2026
1 check passed
@basit3407 basit3407 changed the title [codex] add discovery headers Apr 20, 2026
@basit3407 basit3407 changed the title [codex] improve discovery headers and search console indexing Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants