Technical & Integration Support
Webhooks en cache wissen (Next.js en Frappe)
On-demand ISR begrijpen
Marketora vermijdt de trage herbouwcyclus van traditionele statische sitegeneratoren door Next.js On-Demand ISR (incrementele statische regeneratie) met Frappe Document Event Hooks.
Hoe de revalidatieloop werkt
- 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. - Tagresolutie: 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. - Veilige POST-webhook: Frappe sends a POST request to your Next.js application at
/api/revalidatecontaining the tags and the shared secret: - Timingveilige validatie: 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"]
}Cacheproblemen oplossen
Als updates niet direct zichtbaar zijn, controleer dan dat:
- The
marketing_urlandrevalidate_secretkeys are present insite_config.jsonon your Frappe bench. - The Next.js environment has the matching
REVALIDATE_SECRETvariable set.
