Functions running every second

Hello, we just deployed nextjs app few days ago and noticed increased of function usage. Our site has low to no usage.

Seeing the function log is being invoked every second. is this normal for all nextjs apps deployed in netlify?

Site id: a0734f14-d6b9-44e8-a8f5-a9b63eb4e17a

Hi @rad182,

The part about functions is explained here:

@hrishikesh thanks for the link though I’m aware of the functions being generated.
My issue is that the function is being invoked every second even my site has no traffic at all.
I don’t see any information about this in the site you provided. Please do point me to the right direction.

It appears that you’re using next.config.js redirects for some of the files:

In that case, even if you’re not heavily using SSR, the requests will still be made to the functions to process the Next.js-based redirects.

Basically, the above link was supposed to explain when functions would be used:

  1. They’ll be used every time a server-side page is loaded or some next.config.js redirect needs to be parsed.
  2. They’ll be run once every revalidate period for ISR pages and Next Image component.

So if your function is being used every second, there must be some amount of traffic that would be triggering those functions.

1 Like