XperienceCommunity.OutputCache
1.0.0.6
dotnet add package XperienceCommunity.OutputCache --version 1.0.0.6
NuGet\Install-Package XperienceCommunity.OutputCache -Version 1.0.0.6
<PackageReference Include="XperienceCommunity.OutputCache" Version="1.0.0.6" />
paket add XperienceCommunity.OutputCache --version 1.0.0.6
#r "nuget: XperienceCommunity.OutputCache, 1.0.0.6"
// Install XperienceCommunity.OutputCache as a Cake Addin #addin nuget:?package=XperienceCommunity.OutputCache&version=1.0.0.6 // Install XperienceCommunity.OutputCache as a Cake Tool #tool nuget:?package=XperienceCommunity.OutputCache&version=1.0.0.6
XperienceCommunity.OutputCache
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 (28.2.0 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
Register the services: Add the necessary services to your application's
Startup.cs
orProgram.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)); }); }
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
- Xperience By Kentico - Kentico Xperience
- NuGet - Dependency Management
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Brandon Henricks - Initial work - Brandon Henricks
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Product | Versions 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. |
-
net7.0
- CSharpFunctionalExtensions (>= 2.41.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
-
net8.0
- CSharpFunctionalExtensions (>= 2.41.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.