The repo is an illustration for my article "A way to speed up Next.js dynamic SSR".
To run the tests:
- Clone the repo.
- Run
npm run build
to build a production version of the app; - Run
npm start
to run a local Node.js server that will serve your app; - Open http://localhost:3000/slow in a browser to make sure Next.js creates a filesystem data cache and the first testing request doesn't send any actual network requests;
- Install oha - a tool we will use to send requests to the server;
- Run
oha http://localhost:3000/slow
. It will send 200 requests through 50 parallel connections to the server. - Stop the server and remove the
.next
folder to make sure there is no cached data; - Repeat steps 2–6, but this time use
http://localhost:3000/fast
.