Skip to content

docs: add updateTag example to cacheTag page#94508

Merged
aurorascharff merged 2 commits into
canaryfrom
aurorascharff/cachetag-updatetag-docs
Jun 8, 2026
Merged

docs: add updateTag example to cacheTag page#94508
aurorascharff merged 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.

Copilot AI review requested due to automatic review settings June 6, 2026 13:07
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: e465ff9

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Stats skipped

Commit: e465ff9
View workflow run

@aurorascharff aurorascharff requested a review from icyJoseph June 6, 2026 13:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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
@aurorascharff aurorascharff marked this pull request as draft June 8, 2026 13:37
@icyJoseph icyJoseph force-pushed the aurorascharff/cachetag-updatetag-docs branch from 7c4784b to 81cfe13 Compare June 8, 2026 14:00
@icyJoseph icyJoseph marked this pull request as ready for review June 8, 2026 14:02
@aurorascharff aurorascharff enabled auto-merge (squash) June 8, 2026 14:04
@aurorascharff aurorascharff merged commit 5e14410 into canary Jun 8, 2026
67 checks passed
@aurorascharff aurorascharff deleted the aurorascharff/cachetag-updatetag-docs branch June 8, 2026 14:09
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.

3 participants