SmartCache.NET

SmartCache.NET is a lightweight, high-performance caching executor for .NET applications. Designed with performance and simplicity in mind, it enables developers to optimize their code by reducing redundant operations using thread-safe, in-memory caching techniques.

Why SmartCache.NET?

How It Works

To use SmartCache.NET, simply wrap your expensive code block with:

var result = await Executor.Instance.GetDataAsync(() =>
{
  return ExpensiveOperation();
}, paramValues, 30, 10); // Cache for 30 secs, refresh after 10

Under the hood, SmartCache.NET:

Performance Example

The included Program.cs demo simulates 10 parallel requests. Despite concurrency, the executor ensures only one actual execution happens:

  ---- Starting parallel calls ----
  [CodeBlock] Executed by Thread: 5
  [Total CodeBlock Executions]: 1
  [Total Time]: 510 ms
  

Installation

You can install the NuGet package (coming soon) or clone the repo:

git clone https://github.com/MuhammadOmerKhan/SmartCache.NET.git

Use Cases

Contribute

We welcome contributions, feedback, and stars ⭐ on GitHub!

Visit GitHub Repository →

License

SmartCache.NET is released under the MIT License.