onDemandEntries

Next.js, sunucunun geliştirme sırasında oluşturulan sayfaları nasıl atacağı veya bellekte nasıl tutacağı konusunda size biraz kontrol sağlayan bazı seçenekler sunar.

Varsayılanları değiştirmek için next.config.js adresini açın ve onDemandEntries yapılandırmasını ekleyin:

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,
  },
}