Skip to content

fix: swr cache invalidation#4060

Open
Flo0806 wants to merge 4 commits intonitrojs:v2from
Flo0806:fix/swr-cache-invalidation
Open

fix: swr cache invalidation#4060
Flo0806 wants to merge 4 commits intonitrojs:v2from
Flo0806:fix/swr-cache-invalidation

Conversation

@Flo0806
Copy link

@Flo0806 Flo0806 commented Feb 26, 2026

Hi @pi0!

🔗 Linked issue

fixes: nuxt/nuxt#34189

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

When a cached api endpoint correctly returns a 404 response, the cached entry for that page is not removed or invalidated. This can result in stale content being served from cache even after the page has been unpublished. Now on such errors the cache will be correct invalidated and deleted if needed.

Testing

Added integration tests for it.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@Flo0806 Flo0806 requested a review from pi0 as a code owner February 26, 2026 18:42
@vercel
Copy link

vercel bot commented Feb 26, 2026

@Flo0806 is attempting to deploy a commit to the Nitro Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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.

1 participant