Updated docs
This commit is contained in:
+17
-1
@@ -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` —
|
||||
|
||||
Reference in New Issue
Block a user