Next.js 暴露了某些选项让你能够进行某些控制服务器如何禁用或者在内存中保留内置页面(在开发中) …
为了改变默认行为,你可以配置next.config.js中的onDemandEntries配置
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,},}
