Updated docs

This commit is contained in:
2026-09-09 00:06:18 +02:00
parent fce17654f8
commit 99490bfc4d
3 changed files with 107 additions and 26 deletions
+17 -1
View File
@@ -121,7 +121,7 @@ utrata SEO. **Każdy projekt** tego potrzebuje w next.config:
```ts
const nextConfig: NextConfig = {
htmlLimitedBots:
/Googlebot|Google-InspectionTool|Bingbot|Yandex|DuckDuckBot|Screaming Frog|AhrefsBot|SemrushBot/i,
/Googlebot|Google-InspectionTool|Bingbot|Yandex|DuckDuckBot|Screaming Frog|AhrefsBot|SemrushBot/i,
// ...
}
```
@@ -129,6 +129,22 @@ const nextConfig: NextConfig = {
Weryfikacja: `curl -A "Googlebot" URL | grep canonical` — musi być w `<head>`.
Szczegóły i objawy: seo.md (sekcja htmlLimitedBots).
## 3a2. ISR — cache stron (metadata w head + szybkość)
Dla stron contentowych (page.tsx) użyj ISR: `export const revalidate = 3600`.
Cache'uje całą stronę z gotowym `<head>` → metadata zawsze w head (nie body,
brak race condition streamingu), TTFB ~20ms, brak 503 (cold start).
```ts
// app/(frontend)/[locale]/[[...slug]]/page.tsx
export const revalidate = 3600 // 1h; albo krócej, albo on-demand
```
UWAGA: ISR i `force-dynamic` się WYKLUCZAJĄ. Strony → ISR (revalidate).
sitemap/robots → force-dynamic (bo generują przy żądaniu). Nie mieszaj na jednej
trasie. Treść z panelu: ISR = redaktor czeka do rewalidacji; rozważ on-demand
revalidation (hook afterChange → revalidatePath). Patrz seo.md, HOOKS.md.
## 3b. Pułapka: prerender tras zależnych od bazy (KONIECZNE)
Next domyślnie **prerenderuje** trasy typu `sitemap.ts` w czasie `next build` —