AspNetCore.CacheOutput.LiteDB 1.0.0

Provider for caching using ASPNet OutputCache using LiteDatabase. For using with ASP.NET Core port of Strathweb.CacheOutput library developed by Alexander Shabunevich (https://github.com/Iamcerba/AspNetCore.CacheOutput)

Install-Package AspNetCore.CacheOutput.LiteDB -Version 1.0.0
dotnet add package AspNetCore.CacheOutput.LiteDB --version 1.0.0
<PackageReference Include="AspNetCore.CacheOutput.LiteDB" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AspNetCore.CacheOutput.LiteDB --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

AspNetCore.CacheOutput.LiteDB

Provider for caching using ASPNet OutputCache using LiteDatabase.
Use with a ASP.NET Core port of StratWeb.CacheOutput library (https://github.com/Iamcerba/AspNetCore.CacheOutput)

Initial configuration:

  1. Install ASP.NET Core CacheOutput package: Install-Package AspNetCore.CacheOutput

  2. Install core package: Install-Package AspNetCore.CacheOutput.LiteDB

  3. In "Startup" class "ConfigureServices" method:

    • Register cache key generator:

      services.AddSingleton<ICacheKeyGenerator, DefaultCacheKeyGenerator>();
      
    • Register the provider for LiteDB using default database path:

      services.AddSingleton<IApiOutputCache, InMemoryOutputCacheProvider>();
      

      OR define database path implicity

      services.AddSingleton<IApiOutputCache, LiteDBOutputCacheProvider>(provider =>
      {
          return new LiteDBOutputCacheProvider("newFile.db");
      });
      
  4. In "Startup" class "Configure" method initialize cache output:

    app.UseCacheOutput();
    
  5. Decorate any controller method with cache output filters:

[CacheOutput(ClientTimeSpan = 0, ServerTimeSpan = 3600, MustRevalidate = true, ExcludeQueryStringFromCacheKey = false)]
  1. Read https://github.com/filipw/Strathweb.CacheOutput for more details about common filter usage

AspNetCore.CacheOutput.LiteDB

Provider for caching using ASPNet OutputCache using LiteDatabase.
Use with a ASP.NET Core port of StratWeb.CacheOutput library (https://github.com/Iamcerba/AspNetCore.CacheOutput)

Initial configuration:

  1. Install ASP.NET Core CacheOutput package: Install-Package AspNetCore.CacheOutput

  2. Install core package: Install-Package AspNetCore.CacheOutput.LiteDB

  3. In "Startup" class "ConfigureServices" method:

    • Register cache key generator:

      services.AddSingleton<ICacheKeyGenerator, DefaultCacheKeyGenerator>();
      
    • Register the provider for LiteDB using default database path:

      services.AddSingleton<IApiOutputCache, InMemoryOutputCacheProvider>();
      

      OR define database path implicity

      services.AddSingleton<IApiOutputCache, LiteDBOutputCacheProvider>(provider =>
      {
          return new LiteDBOutputCacheProvider("newFile.db");
      });
      
  4. In "Startup" class "Configure" method initialize cache output:

    app.UseCacheOutput();
    
  5. Decorate any controller method with cache output filters:

[CacheOutput(ClientTimeSpan = 0, ServerTimeSpan = 3600, MustRevalidate = true, ExcludeQueryStringFromCacheKey = false)]
  1. Read https://github.com/filipw/Strathweb.CacheOutput for more details about common filter usage

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 343 9/24/2018