Skip to content

Commit 1fdb5b0

Browse files
committed
Add revalidating cache headers to docs publish
1 parent f0beeed commit 1fdb5b0

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

scripts/publish-docs.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ sync_build() {
4545
return 0
4646
fi
4747

48-
echo "Syncing docs build to s3://$preview_bucket/$prefix"
49-
aws s3 sync "$docs_root/build/" "s3://$preview_bucket/$prefix" --delete
48+
local destination="s3://$preview_bucket/$prefix"
49+
echo "Uploading docs build to $destination with Cache-Control: no-cache"
50+
aws s3 cp "$docs_root/build/" "$destination" --recursive --cache-control "no-cache"
51+
echo "Removing stale docs objects from $destination"
52+
aws s3 sync "$docs_root/build/" "$destination" --delete
5053
}
5154

5255
if [[ ! -f "$docs_root/package.json" ]]; then

website/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ For production publication, the repository-owned
2525
preferred lane. It publishes the stable Keel site plus the `main` preview into
2626
the shared `spoke-previews` bucket through the infra-managed OIDC role. The
2727
checked-in [`publish-docs.sh`](../scripts/publish-docs.sh) script is the local
28-
repair and CI execution surface for that contract.
28+
repair and CI execution surface for that contract. Published docs objects use
29+
`Cache-Control: no-cache` so browsers revalidate with `ETag` and
30+
`Last-Modified`.
2931

3032
## Deployment Inputs
3133

0 commit comments

Comments
 (0)