From 1d2ad48138788000d6dc0f6c503b0236267061ab Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Mon, 6 Jul 2026 10:05:24 +0330 Subject: [PATCH] docs: document why cacheComponents stays disabled Enabling cacheComponents fails the build (/_not-found: uncached data outside ) because the multi-domain layout reads headers() (host) in layout + generateMetadata. Safe adoption would need broad Suspense boundaries and risks cross-domain city content leakage. Co-Authored-By: Claude Fable 5 --- next.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/next.config.js b/next.config.js index 368bbf1..563f6bf 100644 --- a/next.config.js +++ b/next.config.js @@ -7,6 +7,10 @@ const nextConfig = { htmlLimitedBots: /.*/, // React Compiler (پایدار در Next 16) — memoization خودکار کامپوننت‌ها. reactCompiler: true, + // نکته: cacheComponents فعال نشد. معماری multi-domain به headers() (هدر host) در + // layout و generateMetadata وابسته است؛ با cacheComponents هر دسترسی uncached به + // headers() باید داخل بسته شود (build روی /_not-found شکست خورد). این کار + // نیازمند Suspenseگذاری گسترده و ریسک نشت محتوای شهر بین دامنه‌هاست — فعلاً امن نیست. images: { remotePatterns: [ {