Capítulo 204 de 456
cacheMaxMemorySize sets the byte size of the in-memory cache each Next.js server instance keeps (default 50 MB), covering both the prerendered-pages/route-handler/image cache and the built-in use cache handler.
next.config.ts, default 50 * 1024 * 1024 (50 MB).'use cache'.0 = disable both: mimics serverless behavior where entries rarely survive between requests.cacheHandler: set this to 0 when adopting a custom incrementalCacheHandlerPath so reads go to your store, not a per-instance copy.cacheHandlers: if registered, that handler manages its own memory and this option no longer applies to it.import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
cacheMaxMemorySize: 50 * 1024 * 1024, // 50 MB, the default
}
export default nextConfig
cacheMaxMemorySize > 0 com custom cacheHandler externo: cria uma cópia por instância em vez de ler do store compartilhado; zere quando usar handler externo.next dev mantém seu próprio cache em memória independente desta opção; produção respeita o valor configurado exatamente.cacheHandlers custom estiver registrado, ele gerencia sua própria memória, cacheMaxMemorySize deixa de valer pra ele.