Next.js Discord

Discord Forum

Fetching Data on a client

Unanswered
PunchedYou posted this in #help-forum
Open in Discord
Hi Im building a nextjs app which needs to download ~100mb of data from an external server before it starts. I want to save it to an IndexedDB "Dexiejs" afterwards. How do I make sure that the data is downloaded to the client and not to my server and also before the app starts? Sorry if thats a dumb question Im pretty new to React and Next.js.

5 Replies

Stony gall
Your fluency in React or Next has nothing to do with your objectives here. You start from how to work with IndexedDB and it's not React specific.
Hm I know how to use IndexedDB but if I use axios for example to download data from an public api I dont want to use my servers bandwith do I need to use axios in a client component then?
Japanese Bobtail
Client components still get rendered on the server
You'll need to fetch in a useEffect to ensure it's done on the client
Western Meadowlark
Hi, not sure what it is you want to download, but why do you want to download that amount of large data before your application starts?