Where do the function invocations from ___netlify-odb-handler
come from?
#1311
Replies: 2 comments
-
@ascorbic @ericapisani What do you think? |
Beta Was this translation helpful? Give feedback.
-
Hi @remarcable ,
Without seeing your project, I can't speculate as to why the 404 page is being built every time, but what I do know is that NextJS provides a static 404 page by default, and if a custom 404 page is being used within the project, it looks like it needs to be named There's a brief guide on custom 404 pages on the Netlify blog and for a more comprehensive guide, here's the relevant docs on NextJS. We also have a demo site that contains a custom 404 page that is statically generated in case you want to use it to try and compare the differences between your project and what we have to try and determine why it's not being statically generated within your project. I hope that helps in your debugging efforts, but if not, I'll need more information in order to investigate further (in which case an issue should be opened in the event that you're encountering a potential bug within the plugin). |
Beta Was this translation helpful? Give feedback.
-
Hello there (@ascorbic @ericapisani),
we recently switched building a Next.js app on Netlify from using
next build && next export
tonext build
only. This generated three functions, among them___netlify-odb-handler
.I saw in the usage tab in the function settings, that in the last ten days, we used about 70% of the function invocations already. The number of calls to the function surprised me because I thought that all pages were statically generated and there shouldn't be any need to call the function to build any page. Investigating this further, I noticed in the logs that almost 100% of the calls were made to
___netlify-odb-handler
.The logs look like this:
When is
___netlify-odb-handler
invoked? From the logs, it appears it is called whenever a page needs to be built, and therefore in our case whenever a 404 happens (all the paths above don't exist).What is the reason the 404 page needs to be built every time instead of once? Is there a way to disable building the 404 and just display it statically – or if not, to cache the result?
Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions