docs: document why cacheComponents stays disabled

Enabling cacheComponents fails the build (/_not-found: uncached data
outside <Suspense>) 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 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-07-06 10:05:24 +03:30
co-authored by Claude Fable 5
parent 08dd9e408b
commit 1d2ad48138
+4
View File
@@ -7,6 +7,10 @@ const nextConfig = {
htmlLimitedBots: /.*/,
// React Compiler (پایدار در Next 16) — memoization خودکار کامپوننت‌ها.
reactCompiler: true,
// نکته: cacheComponents فعال نشد. معماری multi-domain به headers() (هدر host) در
// layout و generateMetadata وابسته است؛ با cacheComponents هر دسترسی uncached به
// headers() باید داخل <Suspense> بسته شود (build روی /_not-found شکست خورد). این کار
// نیازمند Suspenseگذاری گسترده و ریسک نشت محتوای شهر بین دامنه‌هاست — فعلاً امن نیست.
images: {
remotePatterns: [
{