ISR

ISR

التجديد الثابت المتزايد

GLS-000087

Intermediatereact-nextjs1 min read
incremental static regenerationrevalidateon-demand revalidationnext revalidate

Definition

A Next.js feature that serves static pages from cache but automatically regenerates them after a set time.

ميزة Next.js تُقدِّم الصفحات الثابتة من الذاكرة المؤقتة لكنها تُجدِّدها تلقائيًا بعد وقت محدد.

Why It Matters

ISR is perfect for glossary pages and project listings — they don't change every second, but should update without a full redeploy.

ISR مثالي لصفحات الغلوساري وقوائم المشاريع — لا تتغير كل ثانية، لكن يجب أن تُحدَّث دون إعادة نشر كاملة.

Full Definition

ISR (Incremental Static Regeneration) combines the speed of SSG with the freshness of SSR. A page is statically generated at build time, but Next.js regenerates it in the background after a revalidation period (e.g., every 60 seconds). Visitors always get a fast cached response, but the content stays reasonably fresh. You can also trigger revalidation on-demand when data changes.
ISR (التجديد الثابت المتزايد) يجمع سرعة SSG مع حداثة SSR. تُولَّد الصفحة بشكل ثابت في وقت البناء، لكن Next.js يُعيد توليدها في الخلفية بعد فترة إعادة التحقق (مثلاً كل 60 ثانية). يحصل الزوار دائمًا على استجابة سريعة من الذاكرة المؤقتة، لكن المحتوى يبقى محدثًا بشكل معقول. يمكنك أيضًا تشغيل إعادة التحقق عند الطلب عند تغيير البيانات.

Example Usage

export const revalidate = 3600 at the top of a page component tells Next.js to regenerate this page from fresh data every hour.

export const revalidate = 3600 في أعلى مكوّن الصفحة يُخبر Next.js بإعادة توليد هذه الصفحة من بيانات جديدة كل ساعة.

Knowledge Graph

Avoid these mistakes when using ISR:

1

Setting revalidate = 0 (equivalent to SSR — no caching benefit)

2

Confusing ISR with on-demand revalidation (revalidatePath)

Sign in to unlock guided AI explanations from AI Teacher.

Generate a Prompt

Copy this prompt and use it directly with any AI model — no setup needed.

Ready-to-Use Prompt
Help me build a project using ISR.

Explain:
1. What is ISR and why it matters
2. The core architecture and required tools
3. Step-by-step implementation plan
4. Common mistakes to avoid: Setting revalidate = 0 (equivalent to SSR — no caching benefit), Confusing ISR with on-demand revalidation (revalidatePath)
5. Best practices and production tips

Official Resources