|
2 | 2 | A very lightweight Library for leveraging the power of Lazy<T> for caching at all layers of an application with support for both |
3 | 3 | Sync & Async Lazy operations to maximize server utilization and performance! |
4 | 4 |
|
5 | | -It also supports changing the underlying Cache Repository with different implementations via |
6 | | -ILazyCacheRepository implementation. But the default implementation using .Net MemoryCache is |
7 | | -implemented (via default ICacheRepository implementation as LazyDotNetMemoryCacheRepository) |
8 | | -to enable working with MemoryCache with greatly simplified support for self-populating (Lazy) initialization. |
9 | | -This implementation will work for the vast majority of medium or small projects; but this flexibility allows |
10 | | -for migrating to distributed caches and other cache storage mechanisms easier in the future. |
11 | | - |
12 | | -The use of Lazy<T>, for loading/initializing of data, facilitates a self-populating cache (also known as |
| 5 | +### Give Star 🌟 |
| 6 | +**If you like this project and/or use it the please give it a Star 🌟 (c'mon it's free, and it'll help others find the project)!** |
| 7 | + |
| 8 | +### [Buy me a Coffee ☕](https://www.buymeacoffee.com/cajuncoding) |
| 9 | +*I'm happy to share with the community, but if you find this useful (e.g for professional use), and are so inclinded, |
| 10 | +then I do love-me-some-coffee!* |
| 11 | + |
| 12 | +<a href="https://www.buymeacoffee.com/cajuncoding" target="_blank"> |
| 13 | +<img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"> |
| 14 | +</a> |
| 15 | + |
| 16 | +##Overview |
| 17 | +The use of `Lazy<T>`, for loading/initializing of data, facilitates a self-populating cache (also known as |
13 | 18 | a blocking cache), so that even if many requests, for the same cached data, are triggered at the exact same |
14 | 19 | time, no more than one thread/request (sync or asycn) will ever perform the work -- dramatically decreasing |
15 | 20 | server utilization under high load. |
16 | 21 |
|
| 22 | +LazyCacheHelpers also supports changing the underlying Cache Repository with different implementations via |
| 23 | +`ILazyCacheRepository` implementation. But the default implementation using `.NET MemoryCache` is |
| 24 | +implemented (via default ICacheRepository implementation as LazyDotNetMemoryCacheRepository) |
| 25 | +along with greatly simplified support for self-populating (Lazy) initialization. |
| 26 | + |
| 27 | +The default MemoryCache based implementation will work for the vast majority of medium or small projects; but this flexibility allows |
| 28 | +for migrating to distributed caches and other cache storage mechanisms easier in the future. |
| 29 | + |
17 | 30 | To clarify, what this means is that if many requests for the cached data are submitted at or near the same time |
18 | 31 | then one-and-only-one-call (thread) will execute the long running process while all other requests will immediately benefit from |
19 | 32 | the resulting loaded data immediately, once it is ready. For example, if the long running process takes 3 seconds to complete |
|
0 commit comments