Skip to content

Update hybrid cache documentation on tag removal#37277

Merged
tdykstra merged 6 commits into
mainfrom
tdykstra-patch-1
Jun 23, 2026
Merged

Update hybrid cache documentation on tag removal#37277
tdykstra merged 6 commits into
mainfrom
tdykstra-patch-1

Conversation

@tdykstra

@tdykstra tdykstra commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Clarifies that RemoveByTagAsync performs logical invalidation rather than physical deletion, and explains what "treated as a cache-miss" means in practice.

Fixes #36757

Why this fits:

It stays in the user-doc / conceptual lane.
It explains “treated as a cache-miss” more clearly.
It avoids getting too deep into implementation internals.
It matches the existing recommendation to revise the paragraph at roughly lines 120–123 in hybrid.md.

Summary

Clarifies the "Remove cache entries by tag" section in the HybridCache article.
The previous wording ("treated as a cache-miss") was unclear about how tag invalidation works in practice. This update explains that invalidation is a logical operation rather than a physical deletion, and that older entries are ignored on read rather than actively removed.

What changed

  • Rewrote the explanatory paragraph in `aspnetcore0/performance/caching/hybrid.md
  • Clarified that:
  • RemoveByTagAsync does not delete entries from L1 or L2
  • invalidation works as an "ignore older entries" rule
  • stale entries are treated as cache misses and refreshed

Why

Addresses confusion raised in #36757 about:

  • how invalidation works across processes
  • what "treated as a cache-miss" means
  • whether the factory runs repeatedly after invalidation

Notes

Kept the explanation conceptual (user-doc level), avoiding low-level implementation details.


Internal previews

📄 File 🔗 Preview link
aspnetcore/performance/caching/hybrid.md HybridCache library in ASP.NET Core

Clarifies that RemoveByTagAsync performs logical invalidation rather than physical deletion, and explains what "treated as a cache-miss" means in practice.
Comment thread aspnetcore/performance/caching/hybrid.md Outdated

:::code language="csharp" source="~/performance/caching/hybrid/samples/9.x/HCMinimal/Program.cs" id="snippet_getorcreateoptions" highlight="7,17":::

Remove all entries for a specified tag by calling <xref:Microsoft.Extensions.Caching.Hybrid.HybridCache.RemoveByTagAsync%2A> with the tag value. An overload lets you specify a collection of tag values.

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.

These two duplicate paragraphs to the new text above would be removed.

@wadepickett wadepickett 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.

Few items to fix.

@tdykstra tdykstra marked this pull request as draft June 22, 2026 18:30
tdykstra and others added 3 commits June 22, 2026 15:21
Co-authored-by: Wade Pickett <wpickett@microsoft.com>
Clarified the explanation of tag-based cache entry removal and its logical nature. Updated wording for consistency and clarity.
@tdykstra tdykstra requested a review from wadepickett June 23, 2026 02:44
@wadepickett wadepickett marked this pull request as ready for review June 23, 2026 15:46
Comment thread aspnetcore/performance/caching/hybrid.md Outdated
Comment thread aspnetcore/performance/caching/hybrid.md Outdated

@wadepickett wadepickett 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.

@tdykstra,
Approved. I made some very minor suggestions to consider.

tdykstra and others added 2 commits June 23, 2026 09:53
Co-authored-by: Wade Pickett <wpickett@microsoft.com>
Co-authored-by: Wade Pickett <wpickett@microsoft.com>
@tdykstra tdykstra requested a review from wadepickett June 23, 2026 18:51

@wadepickett wadepickett 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.

Approved. (unblocking merge since it blocks if any commits happen after a review approval now).

@tdykstra tdykstra merged commit 84a5f3a into main Jun 23, 2026
4 checks passed
@tdykstra tdykstra deleted the tdykstra-patch-1 branch June 23, 2026 19:44
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.

How does HybridCache "Remove cache entries by tag" work?

2 participants