This is a Next.js project bootstrapped with create-next-app
.
First, install the dependencies, and start a local redis instance.
Secondly, create a .env
file and populate it similar to .env.example
Then, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
There are 3 routes
In this case the fetching happens exclusively on the client side. Page rendering should be fast, but there will be a loading indicator
The query is prefetched (based on default parameter) on the server-side. The page load is slow, but data is immediately visible.
The query is still prefetched, so the very first load time is slow. However, the queryClient is persisted in redis, thus the subsequent loading is much faster.