Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Cache in-memory #10218

Closed
Rick-Anderson opened this issue Jan 5, 2019 — with docs.microsoft.com · 0 comments · Fixed by #13812
Closed

Update Cache in-memory #10218

Rick-Anderson opened this issue Jan 5, 2019 — with docs.microsoft.com · 0 comments · Fixed by #13812
Assignees
Labels
Pri2 Source - Docs.ms Docs Customer feedback via GitHub Issue
Milestone

Comments

Copy link
Contributor

Rick-Anderson commented Jan 5, 2019

12 K PV/month

Moved from #6808

From @user135711 at #5495 (comment) ...

On the in memory Caching sample, please add an explanation of how cache dependencies work. I've been trying to figure it out from the source code and debugger, and the Docs don't provide sufficient explanation:

    using (var entry = _cache.CreateEntry(CacheKeys.Parent))
    {
        // expire this entry if the dependant entry expires.
        entry.Value = DateTime.Now;
        entry.RegisterPostEvictionCallback(DependentEvictionCallback, this);

        _cache.Set(CacheKeys.Child,
            DateTime.Now,
            new CancellationChangeToken(cts.Token));
    }

How does the child token above communicate to the parent token to evict and what is the purpose of disposing of the parent token? Is this a hack where the parent eviction only occurs because the already marked as expired parent gets evicted when the child cancellation triggers a remove expired entries search?

Second suggestion add to sample app a compatible version of this dependent cache entries construction because it makes more sense: aspnet/Caching#48

Additional

  • The sample app is MVC, not Razor Pages.
  • The topic is in need of a UE pass.

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@dotnet-bot dotnet-bot added the Source - Docs.ms Docs Customer feedback via GitHub Issue label Jan 5, 2019
@Rick-Anderson Rick-Anderson modified the milestones: Discussions, Backlog Jan 5, 2019
@Rick-Anderson Rick-Anderson changed the title Update topic Update Cache in-memory Jan 11, 2019
@Rick-Anderson Rick-Anderson self-assigned this May 9, 2019
@dotnet dotnet locked and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Pri2 Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants