Skip to content

docs: add updateTag example to cacheTag page#94508

Open
aurorascharff wants to merge 2 commits into
canaryfrom
aurorascharff/cachetag-updatetag-docs
Open

docs: add updateTag example to cacheTag page#94508
aurorascharff wants to merge 2 commits into
canaryfrom
aurorascharff/cachetag-updatetag-docs

Conversation

@aurorascharff
Copy link
Copy Markdown
Contributor

What?

Adds an updateTag example to the cacheTag API reference page.

Why?

The cacheTag docs only showed revalidateTag for cache invalidation. For forms and user-triggered mutations (the dominant use case for cacheTag), updateTag is the recommended API because it provides read-your-own-writes semantics. DX agent friction logs showed agents defaulting to revalidateTag and hitting the deprecated single-arg error before discovering updateTag via web search.

How?

Added a second example block after the existing revalidateTag one, showing updateTag('my-data') in a Server Function.

The cacheTag docs only showed revalidateTag for cache invalidation.
For forms and user-triggered mutations, updateTag is the recommended
API (read-your-own-writes). Add an example alongside the existing
revalidateTag one.
Copilot AI review requested due to automatic review settings June 6, 2026 13:07
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2026

Tests Passed

Commit: 7c4784b

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2026

Stats skipped

Commit: 7c4784b
View workflow run

@aurorascharff aurorascharff requested a review from icyJoseph June 6, 2026 13:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an updateTag usage example to the cacheTag API reference to steer readers toward immediate, read-your-own-writes invalidation for user-triggered mutations (e.g. forms), complementing the existing revalidateTag example.

Changes:

  • Adds a new documentation example showing updateTag('my-data') in a 'use server' function.
  • Introduces a short explanatory paragraph describing when to prefer updateTag over revalidateTag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/01-app/03-api-reference/04-functions/cacheTag.mdx Outdated
Per Copilot review: call out the Server Action constraint and
link to the updateTag and Route Handlers docs so readers don't
copy the pattern into unsupported contexts.
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.

2 participants