Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigation between statically generated pages painfully slow in dev mode next.js

Since I added getStaticPaths to pages navigation between pages in development mode (next dev) became painfully slow. Are there any means to optimize this? I have tried to memoize results of related asynchronous calls to database but it seems like did not do anything.

like image 795
Aleksey Avatar asked Nov 06 '22 06:11

Aleksey


1 Answers

When navigating to a new page in dev mode, Next needs to compile the page you are going to. So it is common that there is some time in between navigation.

Also from the docs:

In development, getStaticProps is called on every request.

like image 64
james Avatar answered Nov 15 '22 11:11

james