Skip to content
C# .NET cache class for caching Task-objects.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


See my blog post for full explanation.

TaskCache is a C# .NET custom cache implementation targeted for use cases, where long lasting Task-operations need to be cached.

The implementation uses MemoryCache and persists Lazy<Task<T>> objects in it.

The implementation ensures that

  • No parallel or unnecessary operations to get a value will be started.
  • Failed Tasks are not cached. (No negative caching.)
  • Cache users can't get invalidated results from the cache, even if the value is invalidated during an await.
You can’t perform that action at this time.