GroupDocs.Viewer.UI.Api.Local.Cache
8.1.3
Prefix Reserved
See the version list below for details.
dotnet add package GroupDocs.Viewer.UI.Api.Local.Cache --version 8.1.3
NuGet\Install-Package GroupDocs.Viewer.UI.Api.Local.Cache -Version 8.1.3
<PackageReference Include="GroupDocs.Viewer.UI.Api.Local.Cache" Version="8.1.3" />
<PackageVersion Include="GroupDocs.Viewer.UI.Api.Local.Cache" Version="8.1.3" />
<PackageReference Include="GroupDocs.Viewer.UI.Api.Local.Cache" />
paket add GroupDocs.Viewer.UI.Api.Local.Cache --version 8.1.3
#r "nuget: GroupDocs.Viewer.UI.Api.Local.Cache, 8.1.3"
#:package GroupDocs.Viewer.UI.Api.Local.Cache@8.1.3
#addin nuget:?package=GroupDocs.Viewer.UI.Api.Local.Cache&version=8.1.3
#tool nuget:?package=GroupDocs.Viewer.UI.Api.Local.Cache&version=8.1.3
GroupDocs.Viewer.UI.Api.Local.Cache
GroupDocs.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.
Installation
To use Local Cache in your ASP.NET Core project:
- Add the required package to your project:
dotnet add package GroupDocs.Viewer.UI.Api.Local.Cache
- Configure Local Cache in your
Startupclass:
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();
Configuration Options
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:- An absolute path (e.g.,
"C:/Cache") - A relative path (e.g.,
"./Cache") - A path relative to the application's root directory
- An absolute path (e.g.,
Technical Implementation
The Local Cache implementation stores cached data in the local file system. Here's how it works:
Cache Structure
- Cache entries are stored in a hierarchical directory structure
- Each file's cache entries are stored in a separate subdirectory
- Subdirectory names are derived from the file path (with invalid characters replaced)
- Cache entries are stored as individual files within these subdirectories
Data Serialization
- Uses
System.Text.Jsonfor JSON serialization - Automatically detects the data type and uses appropriate serialization method
File Operations
- Implements file locking mechanism for thread safety
- Uses retry logic with configurable timeout for file operations
- Default wait timeout is 100ms for file operations
- Handles concurrent access through file sharing modes
Cache Key Management
- Cache keys are used as filenames within the cache directory
- File paths are sanitized to create valid directory names
- Maintains a clean directory structure for easy management
Features
- Seamless integration with GroupDocs.Viewer UI
- Persistent caching across application restarts
- Thread-safe file operations
- Automatic retry mechanism for file access
- Support for different data types (bytes, streams, objects)
- Efficient file system organization
- No external dependencies required
Performance Considerations
When using Local Cache:
- Cache size is limited by available disk space
- Cache persists between application restarts
- Best suited for:
- Applications requiring persistent caching
- Environments with sufficient disk space
- Scenarios where memory caching is not suitable
- Performance depends on:
- Disk I/O speed
- File system performance
- Available disk space
Security Considerations
When using Local Cache:
- Ensure the cache directory is not accessible directly through the web server
- Set appropriate file system permissions
- Consider implementing additional security measures if caching sensitive data
- Regularly monitor cache directory size
- Implement cache cleanup strategy if needed
License
This project is licensed under the MIT License - see the LICENSE.txt file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- GroupDocs.Viewer.UI.Core (>= 8.1.3)
-
net8.0
- GroupDocs.Viewer.UI.Core (>= 8.1.3)
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 |
|---|---|---|
| 26.3.0 | 88 | 3/4/2026 |
| 8.1.5 | 112 | 2/19/2026 |
| 8.1.4 | 98 | 2/13/2026 |
| 8.1.3 | 99 | 2/11/2026 |
| 8.1.2 | 442 | 11/17/2025 |
| 8.1.1 | 290 | 9/21/2025 |
| 8.0.7 | 446 | 5/23/2025 |
| 8.0.6 | 325 | 5/5/2025 |
| 8.0.5 | 258 | 4/23/2025 |
| 8.0.4 | 242 | 4/22/2025 |
| 8.0.3 | 229 | 4/4/2025 |
| 8.0.2 | 243 | 2/6/2025 |
| 8.0.1 | 245 | 12/20/2024 |
| 8.0.0 | 195 | 12/16/2024 |
| 6.0.5 | 200 | 12/2/2024 |
| 6.0.4 | 263 | 9/30/2024 |
| 6.0.3 | 276 | 6/11/2024 |
| 6.0.2 | 1,427 | 6/29/2023 |
| 6.0.1 | 256 | 6/29/2023 |
| 6.0.0 | 4,408 | 7/23/2022 |