Technical & Integration Support
वेबहुक और कैश क्लियरिंग (Next.js और Frappe)
ऑन-डिमांड ISR को समझना
Marketora पारंपरिक स्टैटिक साइट जनरेटर के धीमे पुनर्निर्माण चक्रों से बचने के लिए Next.js On-Demand ISR (इंक्रीमेंटल स्टैटिक रीजेनरेशन) के साथ Frappe डॉक्यूमेंट इवेंट हुक्स.
रिवैलिडेशन लूप कैसे काम करता है
- Frappe doc_events: Whenever a content document (e.g.,
MK Help ArticleorMK Blog Post) is created, updated, or trashed, Frappe triggersmarketora_cms.revalidate.on_content_change. - टैग रिज़ॉल्यूशन: The CMS calls
doc.revalidation_tags()to gather the precise cache tags affected. For an article with slugwelcome-to-marketora, the tags includehelp-article:welcome-to-marketoraandhelp-articles. - सुरक्षित POST वेबहुक: Frappe sends a POST request to your Next.js application at
/api/revalidatecontaining the tags and the shared secret: - समय-सुरक्षित सत्यापन: Next.js verifies the secret using a timing-safe equality check, calls
revalidateTag(tag)for each tag, and confirms revalidation with HTTP 200.
{
"secret": "YOUR_REVALIDATE_SECRET",
"tags": ["help-article:welcome-to-marketora", "help-articles"]
}कैश समस्याओं की डीबगिंग
अगर अपडेट तुरंत न दिखें, तो जाँच लें कि:
- The
marketing_urlandrevalidate_secretkeys are present insite_config.jsonon your Frappe bench. - The Next.js environment has the matching
REVALIDATE_SECRETvariable set.
