Skip to content

Avoid request-time blog list refresh#803

Merged
kody-bot merged 1 commit into
mainfrom
cursor/blog-cache-ttl-hotfix-880b
Jun 14, 2026
Merged

Avoid request-time blog list refresh#803
kody-bot merged 1 commit into
mainfrom
cursor/blog-cache-ttl-hotfix-880b

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Keep the blog list cache from becoming stale during public requests so request traffic does not trigger heavy MDX revalidation on the single production event loop.
  • Preserve explicit content refresh/deploy cache generation as the path for updating the blog list cache.

Validation

  • npm run typecheck --workspace kentcdodds.com
  • npm run lint --workspace kentcdodds.com
  • npm run test:backend --workspace kentcdodds.com
  • npm run build --workspace kentcdodds.com
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Chores
    • Optimized blog content caching configuration to improve cache freshness and performance.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 74ce5db2-aeae-4963-8f1c-93c334960426

📥 Commits

Reviewing files that changed from the base of the PR and between 18541c9 and facffce.

📒 Files selected for processing (1)
  • services/site/app/utils/mdx.server.ts

📝 Walkthrough

Walkthrough

A new internal constant blogListTTL is introduced in mdx.server.ts, set to defaultStaleWhileRevalidate. The getBlogMdxListItems function is updated to use blogListTTL as the default ttl for cached blog list entries instead of defaultTTL.

Changes

Blog List Cache TTL

Layer / File(s) Summary
blogListTTL constant and default wiring
services/site/app/utils/mdx.server.ts
Defines blogListTTL = defaultStaleWhileRevalidate and sets it as the default ttl in getBlogMdxListItems, replacing the previous defaultTTL default.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit hops through cached blog rows,
And tweaks the TTL as the stale wind blows.
blogListTTL now leads the way,
SWR's the default of the day!
🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: updating the blog list cache TTL to prevent request-time refresh and avoid unnecessary revalidation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/blog-cache-ttl-hotfix-880b

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 and usage tips.

@kody-bot kody-bot merged commit 2f1915e into main Jun 14, 2026
11 checks passed
@kentcdodds kentcdodds deleted the cursor/blog-cache-ttl-hotfix-880b branch June 14, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants