The name “SWR” is derived from stale-while-revalidate, a HTTP cache invalidation strategy popularized by HTTP RFC 5861. SWR is a strategy to first return the data from cache (stale), then send the fetch request (revalidate), and finally come with the up-to-date data. With SWR, components will get a stream of data updates constantly and automatically. And the UI will be always fast and reactive. With just one single line of code, you can simplify the logic of data fetching in your project, and also have all many amazing features out-of-the-box. SWR has you covered in all aspects of speed, correctness, and stability to help you build better experiences. Fast page navigation, polling on interval, data dependency, revalidation on focus, revalidation on network recovery, local mutation (Optimistic UI), smart error retry, pagination and scroll position recovery, React Suspense, and more.

Features

  • Jamstack oriented
  • Fast, lightweight and reusable data fetching
  • Built-in cache and request deduplication
  • Real-time experience
  • Transport and protocol agnostic
  • TypeScript ready
  • React Native

Project Samples

Project Activity

See All Activity >

Categories

Search, Libraries

License

MIT License

Follow SWR

SWR Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of SWR!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript Search Software, TypeScript Libraries

Registered

2021-03-22