Skip to content

chore(build): stop the sahajatlas.com zone overriding the loader's Cache-Control #148

Closed

Description

@Ardnived

Summary

Make sahajatlas.com serve the loader with the Cache-Control this repo already pins.

Part 2 — the cutover to one embed origin and the retirement of the legacy hosts — moved to #252,
which stays gated on the rewrite being stable. This ticket is Part 1 only.

The repo half has landed. public/_headers pins max-age=0, must-revalidate plus
Access-Control-Allow-Origin: * on /auto.js and /embed.js, and
tests/smoke/cache-headers.smoke.test.ts asserts it. What is left is not a repo change.

The defect

Measured 2026-10-03, on both /embed.js and /auto.js:

Host Cache-Control
sahajatlas.com public, max-age=14400, must-revalidate
sahajatlas.pages.dev public, max-age=0, must-revalidate

must-revalidate survives on the custom domain while max-age does not, so our header is applied
and then rewritten. The cause is a zone-level Browser Cache TTL of 4 hours — Cloudflare's
default, which overrides origin Cache-Control on a custom domain. *.pages.dev is not in the
zone, which is why every check this repo runs sees the correct value.

Four hours of freshness without revalidation, on the one unhashed file hosts hardcode, is the
failure docs/embedding.md §"Updates and caching" warns about: a stale loader imports
content-hashed chunk names the CDN no longer serves, and those 404s kill the widget with no
fallback.

The fix is a dashboard action

Set Browser Cache TTL to "Respect existing headers" on the sahajatlas.com zone. No file in
this repo can do it, and no run of the loop can either — it needs a human in the Cloudflare
dashboard.

⚠ A preview deploy cannot verify this. A preview is *.pages.dev, outside the zone, where the
override does not apply. This ticket's original first criterion asked for exactly that, and is
corrected below. #244's lane, which reads sahajatlas.com itself, is what observes it.

Acceptance criteria

  • Browser Cache TTL on the sahajatlas.com zone is "Respect existing headers".
  • curl -sI https://sahajatlas.com/auto.js returns cache-control: public, max-age=0, must-revalidate and access-control-allow-origin: *. Same for /embed.js.
  • public/_headers pins both headers on both entry files, rather than leaving a rendering requirement on a platform default.
  • A smoke spec covers the loader's content type and Cache-Control, asserting on content, never status (_redirects answers 200 text/html for any path, so a status check passes against a missing file) — tests/smoke/cache-headers.smoke.test.ts.

Non-defects, recorded so they are not "fixed" later

Files affected

  • Cloudflare dashboard — the sahajatlas.com zone. Nothing in this repo.

References

Activity

  1. changed the title [-]fix(build): consolidate the embed origin and pin the loader cache[/-] [+]chore(build): prepare sahajatlas.com and cut over the embed origin[/+] on Aug 14, 2026
  2. added theissue type on Aug 28, 2026
  3. 5 remaining items

  4. added
    bot:working
    on Oct 5, 2026
  5. sydevs-bot commented on Oct 5, 2026

    @sydevs-bot
    Contributor

    🤖 no session running

    recent dispatches
    • 23:31Z answer · attempt 1 · session · done
    • 23:31Z answer · attempt 1 · session

    Written by the sydevs dispatcher. Sessions never edit this comment.

  6. changed the title [-]chore(build): prepare sahajatlas.com and cut over the embed origin[/-] [+]chore(build): stop the sahajatlas.com zone overriding the loader's Cache-Control[/+] on Oct 5, 2026
  7. sydevs-bot commented on Oct 5, 2026

    @sydevs-bot
    Contributor

    Split as asked.

    I also corrected the criterion that asked for verification on a preview deploy. A preview is *.pages.dev, outside the zone, so it cannot show the override. #244's lane reads sahajatlas.com and is what observes it.

    Part 1's repo half is already on main, so both its code criteria are ticked: public/_headers pins max-age=0, must-revalidate and CORS on /auto.js and /embed.js, and tests/smoke/cache-headers.smoke.test.ts asserts it on content. This ticket needs no PR — only the dashboard change.

    🤖 Written by the sydevs autonomous loop — see what this is


    Generated by Claude Code

  8. added and removed
    bot:working
    on Oct 5, 2026
  9. Ardnived commented on Oct 6, 2026

    @Ardnived
    ContributorAuthor

    Browser Cache TTL on the sahajatlas.com zone is now "Respect Existing Headers" (set in the dashboard). Verified 2026-10-05:

    File cache-control access-control-allow-origin content-type
    https://sahajatlas.com/auto.js public, max-age=0, must-revalidate * application/javascript
    https://sahajatlas.com/embed.js public, max-age=0, must-revalidate * application/javascript

    All acceptance criteria are met. Part 2 continues in #252.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    Medium

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions