XperienceCommunity.OutputCache 1.0.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package XperienceCommunity.OutputCache --version 1.0.0.5                
NuGet\Install-Package XperienceCommunity.OutputCache -Version 1.0.0.5                
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="XperienceCommunity.OutputCache" Version="1.0.0.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XperienceCommunity.OutputCache --version 1.0.0.5                
#r "nuget: XperienceCommunity.OutputCache, 1.0.0.5"                
#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 XperienceCommunity.OutputCache as a Cake Addin
#addin nuget:?package=XperienceCommunity.OutputCache&version=1.0.0.5

// Install XperienceCommunity.OutputCache as a Cake Tool
#tool nuget:?package=XperienceCommunity.OutputCache&version=1.0.0.5                

XperienceCommunity.OutputCache

License Build Status

Overview

XperienceCommunity.OutputCache is a .NET library designed to seamlessly integrate output caching with Xperience by Kentico, supporting .NET 7 / 8. This library facilitates efficient cache invalidation, triggered by content updates within the Kentico CMS, ensuring that your application's content remains fresh and up-to-date without compromising on performance. Output caching can significantly improve the responsiveness of your web applications by storing the rendered output of pages, reducing the need for repeated processing of requests for the same content.

Why Use Output Caching?

  • Improved Performance: Reduces server load and response times by serving content from the cache.
  • Dynamic Content Updates: Ensures users see the most current content without manual cache clearing, thanks to automatic invalidation.

Features

  • Seamless Integration: Easily integrates with .NET 7 / 8 output cache, enhancing your Kentico Xperience projects.
  • Cache Invalidation: Automatically invalidates cached content upon updates to pages within Kentico, ensuring content freshness.
  • High Performance: Leverages .NET's advanced caching mechanisms for optimal performance.

Getting Started

Prerequisites

  • .NET 7 or 8 installed on your development machine.
  • An existing project with Xperience by Kentico (29.1.4 or higher).

Installation

To integrate XperienceCommunity.OutputCache into your project, follow these steps:

Via NuGet Package Manager Console

Open the NuGet Package Manager Console in Visual Studio and run:

Install-Package XperienceCommunity.OutputCache

Configuration

  1. Register the services: Add the necessary services to your application's Startup.cs or Program.cs.

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddControllersWithViews();
    
        // Add Xperience Output Cache services
        services.AddXperienceOutputCache();
    
        // Other Xperience Output Cache Policy.
        services.AddOutputCache(options =>
        {
            options.AddXperienceOutputCachePolicy("KenticoPolicy", TimeSpan.FromMinutes(5));
        });        
    }
    
  2. Configure the middleware: Ensure the middleware is configured in your request pipeline.

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        // Use Output Cache middleware
        app.UseOutputCache();
    }
    

Usage

Output caching is now enabled for your application. The library will automatically handle caching and invalidation based on updates within Xperience by Kentico. To add output caching to your views, use the OutputCache attribute on your controller actions:

[OutputCache(PolicyName = "KenticoPolicy")]
public async Task<IActionResult> Index()
{
    return View();
}

Helper Methods:

The library includes the AddDependencyKeys() extension method for use with HttpContext. This method is intended for use on controllers and view components to enhance cache dependency management, ensuring more precise and efficient cache invalidation.

Built With

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

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 is compatible.  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.

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.0.6 94 8/29/2024
1.0.0.5 100 7/18/2024
1.0.0.3 85 7/11/2024
1.0.0.2 89 7/11/2024
1.0.0.1 90 7/10/2024