Hi,
I’m currently hosting a Next.js website on Netlify, and I’m encountering something puzzling with the Function Next.js Server Handler. My website primarily uses SSG for generating pages, and I rely on generateStaticParams for that purpose. The domain for my site is sunicadesign.netlify.app.
While the site doesn’t receive heavy traffic, I’ve noticed a massive number of invocations for the Function Next.js Server Handler —approximately 9.7K requests in just two days. For example, in my Function Logs, I see lots of entries like this:
Jan 24, 11:39:09 AM: 5d3499d6 Duration: 143.35 ms Memory Usage: 317 MB
Questions:
- Identifying Triggered Paths:
Is there a way to figure out which specific paths are triggering the Function Next.js Server Handler? This would really help me understand what’s happening.
- Relation to CDN Cache:
Based on my understanding, SSG pages that are not cached in the CDN should trigger the function, while cached pages should not. Is this correct?
I also assumed that after a new deployment, this function would be triggered at scale until the pages are cached, after which the invocations would decrease significantly. However, I’m not observing this kind of behavior. The invocations remain unexpectedly high.
Does anyone have insights into why this might be happening or how to troubleshoot further? Your help would be greatly appreciated!
Thank you!