Refresh social preview filename and shorten HTTP cache#46

merged
main
fix/social-preview-cache
opened10d agobySscreen-gd
View on GitHubRepository sync pausedPR last imported 7d ago

X can retain an older card even after the site serves updated metadata and artwork. Give the JPEG a new filename and reference it in both Open Graph and Twitter metadata. Set HTTP cache freshness to 60 seconds for the legacy and versioned preview paths, and update the image generator.

Validation: typecheck, production build, discovery tests, and local HTTP checks passed. Both JPEG paths return 200 with the 60-second cache header. Twitterbot receives metadata referencing the versioned image. X's independent card cache is not controlled by these headers; use a fresh share URL when needed.

Summary by CodeRabbit

  • Bug Fixes
    • Updated the social preview image used when sharing the site, helping new shares show the latest preview.
    • Reduced the browser and shared-cache duration for the current and previous preview images to 60 seconds, so updates can become available sooner.
    • Kept the previous preview image available. Social platforms may still retain cached previews, and refresh timing is not guaranteed.

Checks

Checks in progress
Sscreen-gdopened·10d ago
V

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated
External image colReady ReadyPreviewOct 2, 2026 4:15pm UTC
C

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

[!NOTE] Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 8867bb50-65f4-4726-99d6-6edf267aae41

📥 Commits

Reviewing files that changed from the base of the PR and between 60fa90ea3e7900fd4ee2e6dfc906c6b64be13186 and 370a96d503f556f34e8b35b0231ace5f9fb40fc4.

⛔ Files ignored due to path filters (1)
  • public/col-social-preview-v5.jpg is excluded by !**/*.jpg
📒 Files selected for processing (5)
  • docs/visibility.md
  • lib/site.ts
  • next.config.ts
  • scripts/generate-social-image.mjs
  • tests/discovery.test.mjs
ascii
1 ____________________________________________________________
2< To iterate is human, to recurse divine. - L. Peter Deutsch >
3 ------------------------------------------------------------
4 \
5 \ (\__/)
6 (•ㅅ•)
7 /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.