getStaticProps Page get requested 3 times instead of 1 on Vercel #290
Replies: 0 comments 16 replies
-
My issue is still actual, still not quite understand why it is happening. It seems similar to vercel/vercel#6581, but not quite. I don't understand why for prefetching link Vercel does 3 requests? (basically runs |
Beta Was this translation helpful? Give feedback.
-
Answered in vercel/vercel#6581 (comment). |
Beta Was this translation helpful? Give feedback.
-
I may have the same or a similar issue. Almost all requests to pages with getStaticProps show at least 2 times in the Vercel function logs. See screenshot: https://prnt.sc/1qf5ehr Does this also mean that these functions are counting twice towards the serverless function usage limit? |
Beta Was this translation helpful? Give feedback.
-
Currently I am experiencing this exact same problem. |
Beta Was this translation helpful? Give feedback.
-
So I have quite simple app, with basically 1 dynamic page.
It has
and
getStaticProps
handler with 1 api request andrevalidate: 300
It works fine locally when I build and start application in production mode.
It works fine on VPS, where I basically do the same only through docker.
But on Vercel for some reason data for this page gets requested 3 times (before it gets cached).
Both on direct navigation and on
Link
prefetching (both default mode and on hover). There is only 1 request from browser, but my server (simple fastify app) bombed with 3 requests for every page. So if there are 10Link
s with prefetch server actually gets 30 requests at the same time.I don't quite understand why it happens, maybe I am using Vercel wrong.
For example, log from server:
As you can see there are 3 consecutive requests for the same page, and my getStaticProps function only has 1 api call, and as I said it works fine outside of Vercel.
I hope I've explained everything clearly enough. Ready to answer other questions, thanks everyone in advance :)
Beta Was this translation helpful? Give feedback.
All reactions