fix(docs): deploy on blog changes, correct GitHub repo, stop cross-locale homepage caching#13
Merged
Merged
Conversation
…cale homepage caching Three fixes prompted by live-site issues: 1. deploy-docs.yml only triggered on content/docs/** — blog-only changes (like the expanded 'extend existing systems' post in #12) never deployed. Add content/blog/** to the path filter. 2. gitConfig.repo was 'spec' → the navbar GitHub link and the docs 'edit this page' link pointed at objectstack-ai/spec. Correct to objectstack-ai/objectos (where this content actually lives). 3. The prefix-less homepage ('/') is statically cached with s-maxage=31536000 and no Vary on Accept-Language. Its body, however, is language-negotiated by middleware — so a shared cache stored the English homepage at '/' and served it to every visitor, and non-English browsers stopped being redirected to their localized path. Mark the default-locale rewrite response 'private, no-cache' so the edge never shares it and middleware re-runs language detection per request. (Verified the redirect logic itself is correct: a cache-miss request with Accept-Language: zh-CN already 307s to /zh-Hans.)
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.
Three fixes prompted by issues seen on the live site (objectos.ai).
1. Blog changes never deployed
deploy-docs.ymlonly triggered oncontent/docs/**. The expanded blog post (#12) only touchedcontent/blog/**, so no deploy fired — the live blog still shows the old short version. Addedcontent/blog/**to the path filter.2. Wrong GitHub repo
gitConfig.repowas'spec', so the navbar GitHub link and the docs edit this page link pointed atgithub.com/objectstack-ai/spec. Corrected toobjectos, where this content actually lives.3. Chinese (and other) browsers not redirected from the homepage
The redirect logic is actually correct — a cache-miss request proves it:
The bug is caching: the prefix-less
/(default/English) is served withcache-control: s-maxage=31536000and noVary: Accept-Language. A shared cache stores that English homepage at/and serves it to everyone, so non-English visitors never hit the middleware redirect. Fix: mark the default-locale rewrite responseprivate, no-cache, must-revalidateso the edge never shares it and middleware re-runs language detection on every request.After merge
This PR touches
apps/docs/**and.github/workflows/deploy-docs.yml, so merging will trigger a docs deploy that also publishes the already-merged expanded blog post. Verification post-deploy: hit/with azh-CNAccept-Language and confirm the 307, and confirm the navbar GitHub link resolves to/objectos.Build:
pnpm --filter docs build→ green (509 static pages).