GroupDocs.Viewer.UI.Api.Local.Cache containing local file-cache implementation that can be used with GroupDocs.Viewer.UI.Api see https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET-UI for more details.
$ dotnet add package GroupDocs.Viewer.UI.Api.Local.CacheGroupDocs.Viewer.UI.Api.Local.Cache is a local file system caching implementation that can be used with GroupDocs.Viewer.UI.Api. It provides persistent caching for document rendering results in your GroupDocs.Viewer.UI application.
To use Local Cache in your ASP.NET Core project:
dotnet add package GroupDocs.Viewer.UI.Api.Local.Cache
Startup class:var builder = WebApplication.CreateBuilder(args);
builder.Services
.AddGroupDocsViewerUI();
builder.Services
.AddControllers()
.AddGroupDocsViewerSelfHostApi()
.AddLocalStorage("./Files")
.AddLocalCache("./Cache"); // Path to your cache directory
var app = builder.Build();
app
.UseRouting()
.UseEndpoints(endpoints =>
{
endpoints.MapGroupDocsViewerUI(options =>
{
options.UIPath = "/viewer";
options.ApiEndpoint = "/viewer-api";
});
endpoints.MapGroupDocsViewerApi(options =>
{
options.ApiPath = "/viewer-api";
});
});
await app.RunAsync();
The Local Cache implementation requires a single configuration option:
cachePath (Required): The path to the directory where cache files will be stored. This can be:
"C:/Cache")"./Cache")The Local Cache implementation stores cached data in the local file system. Here's how it works:
System.Text.Json for JSON serializationWhen using Local Cache:
When using Local Cache:
This project is licensed under the MIT License - see the LICENSE.txt file for details.