Using REN.Kit’s Built-in In-Memory Cache Service
How to Use the Built-In In-Memory Cache
[Route("api/[controller]")]
[ApiController]
public class StandardCacheController(IRENCacheService cacheService) : ControllerBase
{
/// <summary>
/// Adds or updates an item in the cache.
/// </summary>
[HttpPost("set")]
public async Task<IActionResult> SetCache([FromQuery] string key, [FromBody] object value)
{
await cacheService.SetAsync(key, value, TimeSpan.FromMinutes(10));
return Ok("Value cached.");
}
}Supported Operations
Last updated