Skip to content

SmartCache.NET is a high-performance, thread-safe caching executor for .NET. It supports synchronous and asynchronous data fetching with TTL-based caching and optional background refresh. Eliminate redundant computations, boost performance, and simplify caching logic in your apps.

License

Notifications You must be signed in to change notification settings

MuhammadOmerKhan/SmartCache.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartCache.NET 🚀

A high-performance, thread-safe, pluggable in-memory caching executor for .NET developers. Supports optional async refresh, TTL-based expiry, and intelligent cache invalidation.

🌟 Why SmartCache.NET?

SmartCache.NET helps you reduce redundant computation and improve application responsiveness with:

  • Thread-safe caching
  • 🔄 Async refresh support
  • 🧠 Smart locking & deduplication
  • ⏱️ Configurable TTL
  • 💡 Minimal setup — plug and play!

🔧 How It Works

Just wrap your logic with Executor.Instance.GetDataAsync or GetData and get optimized performance out of the box!

var result = await Executor.Instance.GetDataAsync<string>(() => {
    return ExpensiveComputation();
}, parameters, cacheDuration: 30, asyncRefreshAfterSecs: 120);

📦 Installation

dotnet add package SmartCacheNET

Or Clone:

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

🚀 Benchmark Sample

The Program.cs demonstrates 10 concurrent calls using a shared cache key:

[Total CodeBlock Executions]: 1
[Total Time]: 505ms

Even with 10 parallel threads — only 1 execution happened. That’s the power of SmartCache.NET.

📁 Folder Structure

SmartCache.NET
  /Executor.cs  -> Core logic
  /Program.cs   -> Usage demo with benchmark

📜 License

  • MIT License. Do whatever you want — just give credit.

🤝 Contributing

  • Star 🌟 this repo
  • Fork 🍴 and submit a PR
  • Raise issues or improvements

🔗 Follow Me

GitHub LinkedIn X


MIT License .NET 8.0+ Made with 💙

About

SmartCache.NET is a high-performance, thread-safe caching executor for .NET. It supports synchronous and asynchronous data fetching with TTL-based caching and optional background refresh. Eliminate redundant computations, boost performance, and simplify caching logic in your apps.

Topics

Resources

License

Stars

Watchers

Forks

Languages