By default the find api is limited at 100. Question

I understand that that is due to performance concern. But what about if I were to set it to -1 only for getstaticpath? i would want my users to be able to find any posts with /slug. Meaning, that full set data is only to get to the page itself, not to be used on the search page or whatever. Will that still be an issue?

No, it’s only really there for multiple queries (pages that have to constantly call the backend to load). If you are statically building the page once it’s not a problem.

A good example to NOT do this is things like Reddit, where as you scroll it will load more entries (It doesn’t try to load all threads at once or all comments at once, commonly called lazy-loading or inf scroll)

Ideally it’s never usually a good idea to use -1 but in some rare cases it can be used without too much impact.

I notice that if I have 300 posts, I can’t have all the {slug} params in getstaticpath in Next js, only 100 paths will be returned and that will result in a 404 page if the slug is not found. So i need to return all slug in order to fetch the page data with the slug. So if I use -1 for this case, it won’t have too much impact right?

No it shouldn’t but it should also be possible to page through responses with Next.js :thinking: