-
Notifications
You must be signed in to change notification settings - Fork 433
fix(og): add version parameter to OG URLs to bust stale browser cache #2087
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for hyprnote-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for hyprnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughAppends a static cache-busting query parameter Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
Comment |
Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
Summary
Adds a
&v=1version parameter to all OG image URLs to force browsers to fetch fresh images instead of serving stale cached versions.Root cause: PR #2086 added proper Netlify CDN cache headers (
Netlify-Vary: query), but users who had previously visited the site still had the old (incorrect) OG images cached in their browser. Because the cache headers includemax-age=31536000, immutable, browsers won't revalidate these URLs until the cache expires (1 year).Fix: Adding a version parameter (
&v=1) changes the URL, forcing all browsers to treat it as a new resource and fetch fresh images. This is a standard cache-busting technique.Files updated:
apps/web/src/routes/_view/index.tsx(homepage blog section)apps/web/src/routes/_view/blog/$slug.tsx(blog pages + related articles)apps/web/src/routes/_view/changelog/$slug.tsxapps/web/src/routes/_view/docs/$.tsxapps/web/src/routes/_view/templates/$slug.tsxapps/web/src/routes/_view/shortcuts/$slug.tsxapps/web/src/routes/_view/gallery/$type.$slug.tsxReview & Testing Checklist for Human
&v=1and are not served from memory cachev=1tov=2to invalidate caches againRecommended test plan: After deployment, open the homepage in an incognito window, scroll to the blog section, and verify each blog card displays a unique OG image with the correct title/date.
Notes