Skip to content

[nextjs][nextjs-app-router-osr] OSR App Router Template with Tag Revalidation Support#468

Open
MenKNas wants to merge 9 commits into
devfrom
feature/JSS-8985-tag-based-OSR-support-for-app-router
Open

[nextjs][nextjs-app-router-osr] OSR App Router Template with Tag Revalidation Support#468
MenKNas wants to merge 9 commits into
devfrom
feature/JSS-8985-tag-based-OSR-support-for-app-router

Conversation

@MenKNas
Copy link
Copy Markdown
Contributor

@MenKNas MenKNas commented May 6, 2026

Description / Motivation

Summary

This PR introduces a new Next.js App Router template with OSR and tag revalidation out of the box.
It adds deterministic tag-based revalidation so published Sitecore changes refresh cached content reliably.
It also introduces two revalidation paths: a manual path for explicit tags and a webhook path that maps publish events to tags.
Finally, it adds dictionary fallback invalidation in the webhook flow to reduce stale dictionary-content cases.

As a side note, I decided to add two revalidation paths with distinct responsibilities:

  • Manual route for direct, explicit tag invalidation (useful for local debugging and operational/manual cache clears). This route is also a good base for custom workflows built on top of tag invalidation. (/revalidate/)
  • Webhook route for publish-event payloads, where the app translates event data into cache tags before invalidation. This route is intended for Sitecore-driven events. (/revalidate/webhook)

I found this separation of concerns more useful, but I’m happy to discuss if there is a strong reason to consolidate everything into a single route.

Testing Details

  • Unit Test Added
  • Manual Test/Other

Verified end-to-end with local app + ngrok webhook URL: published Sitecore content, confirmed webhook calls hit /api/revalidate/webhook , and confirmed updated content appears after refresh for both route and dictionary changes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

📦 Package Size and Test Coverage Report

Package Base Size PR Size Δ Change Base Coverage PR Coverage Δ Change
analytics-core 67.34 KB 67.34 KB ✅ 0.00 KB 97.40% 97.40% 0.00%
cli 59.14 KB 59.14 KB ✅ 0.00 KB 70.09% 70.09% 0.00%
content 425.31 KB 425.31 KB ✅ 0.00 KB 92.27% 92.27% 0.00%
core 120.38 KB 120.38 KB ✅ 0.00 KB 91.25% 91.25% 0.00%
create-content-sdk-app 336.21 KB 399.77 KB 🔺 +63.56 KB 96.35% 96.35% 0.00%
events 72.27 KB 72.27 KB ✅ 0.00 KB 97.97% 97.97% 0.00%
nextjs 508.95 KB 543.22 KB 🔺 +34.27 KB 90.78% 91.08% +0.30%
personalize 64.01 KB 64.01 KB ✅ 0.00 KB 99.74% 99.74% 0.00%
react 230.78 KB 230.78 KB ✅ 0.00 KB 93.80% 93.80% 0.00%
search 8.10 KB 8.10 KB ✅ 0.00 KB 98.57% 98.57% 0.00%
Total 🔺 +97.83 KB

@MenKNas MenKNas requested a review from illiakovalenko May 6, 2026 14:04
@MenKNas MenKNas self-assigned this May 6, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

🦋 Changeset detected

Latest commit: 333773e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@sitecore-content-sdk/nextjs Minor
create-content-sdk-app Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant