#Is it a good idea to mark methods as `use client` to save server compute time (cost)?

4 messages · Page 1 of 1 (latest)

mellow shard
#

I am new to nextjs, and I am using Vercel as a host platform. I noticed that they bill by server compute time (1000 hr per month for the $20 premium plan and surcharges beyond that).

I am still developping my application, and noticed that my server compute time is actually relatively high (not that high, but with no real users, just myself running dev runs, I already saw a few hours of compute time).

So that prompted me to think that maybe I can mark some the data processing calculations as use client. These are usually after a database data-fetch query, that I still need to process them before displaying it on the pages. I am sure by default these are executed on server, incurring server compute time. So if I mark them to use client, maybe I can save server compute time after I release the site.

But I am still not that familiar with the pros and cons of use client vs use server. Could someone offer some insights to my thoughts above?

Thanks.

tight pollenBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

pale heron