releases.sh

RSC cache preloading; unload() clears cache

v2.5.0

August 3, 2026SWRView original ↗
2 features1 fixThis release2 featuresNew capabilities1 fixBug fixesAI-tallied from the release notes
From the original release noteView original ↗

Features

RSC cache preloading

Preload data in React Server Components and pass it to client hooks through SWRConfig. This avoids a duplicate initial browser request and hydrates the result into the SWR cache. The new cacheData option is experimental.

https://github.com/vercel/swr/pull/4275

New unload() API

Use unload() to clear the entire SWR cache and discard in-flight requests and mutations. Mounted hooks revalidate by default, or you can pass { revalidate: false } to keep the cache empty until the next revalidation.

https://github.com/vercel/swr/pull/4298

Fixes

New Contributors

Full Changelog: https://github.com/vercel/swr/compare/v2.4.2...v2.5.0

Fetched August 3, 2026