ProactiveCaching 1.0.1

dotnet add package ProactiveCaching --version 1.0.1
NuGet\Install-Package ProactiveCaching -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ProactiveCaching" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ProactiveCaching --version 1.0.1
#r "nuget: ProactiveCaching, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ProactiveCaching as a Cake Addin
#addin nuget:?package=ProactiveCaching&version=1.0.1

// Install ProactiveCaching as a Cake Tool
#tool nuget:?package=ProactiveCaching&version=1.0.1

ProactiveCaching

ProactiveCaching is a .NET library designed to provide proactive caching functionality. Its core philosophy is to prioritize user experience by ensuring data is always available instantly, with no wait time. Based on 7.0 / .NET Standard.

Unique Selling Point

  • Proactive Refreshes: Instead of waiting for a request to retrieve data, ProactiveCaching periodically refreshes the cache at specified intervals. This ensures that the data is always up-to-date and ready to be served.

  • Atomic Data Switch: Data transitions from old to new occur atomically. When new data is ready, it replaces the old cache instantaneously, ensuring that clients always retrieve the latest available data without any delay.

  • Fault Tolerance: If fetching the new data fails for any reason, ProactiveCaching ensures that the old data remains intact and available. This resilience guarantees that users are not left without data due to intermittent issues or failures.

Additional Features

  • Flexible Data Sources: Can work with any asynchronous data source.

  • Exception Handling: Gracefully handles exceptions during data fetch operations.

  • Async-Aware: Fully asynchronous API to work seamlessly in modern .NET applications.

Leverage ProactiveCaching to optimize your applications by always having fresh data at your fingertips, without compromising on speed or reliability.

Getting Started

  1. Installation: Install the ProactiveCaching NuGet package.

    Install-Package ProactiveCaching
    
  2. Basic Usage:

    var proactiveCache = new ProactiveCache<string>(
        async () => await GetDataFromDatabase(),
        refreshPeriod: TimeSpan.FromMinutes(5)
    );
    
    var data = await proactiveCache.GetDataAsync();
    

Contributing

This project can be found on GitHub.

Please ensure to update tests as appropriate.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 247 10/21/2023
1.0.0 102 10/21/2023

Initial release of ProactiveCaching.