NextJS split chunks caching not working in dev mode

Viewed 433

I'm using next.js in dev mode (not production build) in the following way:

npm run dev 

in package.json the dev command is:

cross-env NODE_ENV=development node server/server.js

Then when I open the app url, it takes 30 seconds to load all different chunks even though code has not been updated at all.

When I check Cache-Control property of each chunk it says 'no-store'.

When running next.js in prod mode everything loads much faster and cache-control age is set to max.

In next.js codebase I can see that chunks and cache are only enabled in production settings but I need them in dev as well: enter image description here

Is there a way to use the prod settings of chunks and caching when running next.js app in dev mode?

0 Answers
Related