onDemandEntries
Next.js は、開発中にサーバーがビルドされたページを破棄またはメモリに保持する方法を制御できるオプションをいくつか公開しています。
デフォルトを変更するには、next.config.js
を開き、onDemandEntries
設定を追加します。
next.config.js
module.exports = {
onDemandEntries: {
// period (in ms) where the server will keep pages in the buffer
maxInactiveAge: 25 * 1000,
// number of pages that should be kept simultaneously without being disposed
pagesBufferLength: 2,
},
}
この情報は役に立ちましたか?