Skip to content

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

Contributors

Languages