{/* The content of this doc is shared between the app and pages router. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}Next.js 提供了一些选项,让你可以控制服务器在开发环境中如何处理或保留已构建的页面。
要更改默认设置,请打开 `next.config.js` 并添加 `onDemandEntries` 配置:
```js filename="next.config.js"module.exports={onDemandEntries:{// period (in ms) where the server will keep pages in the buffermaxInactiveAge:25*1000,// number of pages that should be kept simultaneously without being disposedpagesBufferLength:2,},}