Next.js Discord

Discord Forum

can server action run on edge?

Unanswered
mihir posted this in #help-forum
Open in Discord
title

6 Replies

I'm using gemini api which takes longer than 10 secs sometimes to respond which is causing in a few errors i was thinkking if i could change it to edge function
but not sure how to do it
If you host on vercel you can't exceed a certain time limit
Dosent matter edge or not.
@mihir I'm using gemini api which takes longer than 10 secs sometimes to respond which is causing in a few errors i was thinkking if i could change it to edge function
Server Actions inherit the runtime of the page/layout they are called in, so yes you can use edge server actions.

As for the timing out part you'll have to see if switching to edge fixes the issue or not by yourself
It probably will still time out.