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,
},
}役に立ちましたか?