Revalidate the pages tag on publish (refresh query-index)#32
Closed
lamontacrook wants to merge 1 commit into
Closed
Revalidate the pages tag on publish (refresh query-index)#32lamontacrook wants to merge 1 commit into
lamontacrook wants to merge 1 commit into
Conversation
/api/revalidate now clears the `pages` tag in addition to page:<slug>. The query-index feed (cached under `pages`) drives navigation, generateStaticParams, and page metadata; publishing a new or renamed page previously didn't refresh it, so the nav mega-menu and SSG params lagged until the feed's time-based cache expired. Clearing `pages` on every publish keeps them current. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
Commits
|
Contributor
Author
|
Not the right approach — dropping the revalidate/pages-tag machinery in favor of fetching the full query-index fresh (no stale cache). See replacement PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
/api/revalidatenow callsrevalidateTag('pages')in addition torevalidateTag('page:<slug>').Why
The
query-indexfeed is cached under thepagestag (lib/eds/queryIndex.js) and drives:generateStaticParams(which pages get prerendered),generateMetadata, PR Add per-page metadata (generateMetadata from query-index) #31).Publishing a page only cleared that page's own
page:<slug>tag, neverpages— so newly published/renamed pages didn't appear in the nav/SSG/metadata until the feed's 1-hour cache expired. This surfaced as a mega-menu row showing only the link label (no image/description) for a freshly published page.Clearing
pageson every publish keeps query-index-derived features current immediately.Verified
npm run lintclean;npm run buildsucceeds (/api/revalidatecompiles).🤖 Generated with Claude Code