Skip to content

Checking cache for key without loading the value #87

Answered by jodydonetti
seyfeb asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @seyfeb , and thanks for considering FusionCache!

The underlying 2nd level works via the standard IDistributedCache interface: this allows FusionCache to automatically work with any of the available implementations of a distributed cache in .NET (see a list here).

The downside is that the methods at FusionCache disposal are only the ones defined in the IDistributedCache interface (see here) which are:

  • Get/GetAsync
  • Refresh/RefreshAsync
  • Remove/RemoveAsync
  • Set/SetAsync

As you can see there is not an available method to just check for the existence of an entry without getting the entry itself.

If you have any idea on how to bypass this limit I'm open to suggestions!

ps: I'm playing with …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@seyfeb
Comment options

@jodydonetti
Comment options

@seyfeb
Comment options

Answer selected by seyfeb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants