Skip to content

Conversation

@MarkCiliaVincenti
Copy link
Contributor

Also allows configuration of sliding expiration.

@linkdotnet
Copy link
Owner

linkdotnet commented Nov 15, 2025

Hey @MarkCiliaVincenti - that is a good one.

Instead of rolling out a custom version, I'd prefer either something like Microsofts IHybridCache or @jodydonetti 's FusionCache implementation (which I use in other projects successfully).

Reason being is that the internals on how the protection is happening is part of the implementation and doesn't spill out to the using object.

@MarkCiliaVincenti
Copy link
Contributor Author

What do you think now, @linkdotnet?

Copy link
Owner

@linkdotnet linkdotnet left a comment

Choose a reason for hiding this comment

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

Good direction - I think we can reduce some complexity and role with "more" default-ish settings.

Removed singleton registration for AsyncKeyedLocker.
Removed unused AsyncKeyedLock namespace.
@Arnab-Developer
Copy link
Contributor

Arnab-Developer commented Nov 16, 2025

I have a question.

FusionCache has a L2 caching (distributed caching) option. But in this project, we are not using any L2 caching. In this pull request, are we using FusionCache only for the stampede protection?

@linkdotnet
Copy link
Owner

Basically: Yes. And to some extent because th API surface of FusionCache is nice.

if someone wants to use redis or so on top - it would be just a matter of a few more extra lines of code.
But not sure of someone needs that scaling for that blog software.

@linkdotnet linkdotnet merged commit 4ad0bd0 into linkdotnet:master Nov 16, 2025
3 checks passed
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