Request Caching - angelobreuer/Lavalink4NET GitHub Wiki
Lavalink4NET supports request caching of tracks to the Lavalink node.
To use this feature an implementation of ILavalinkCache is required. You can use the Lavalink4NET.MemoryCache NuGet-Package for an example implementation.
using Lavalink4NET;
using Lavalink4NET.MemoryCache;
var cache = new LavalinkCache(); // <--
var myNode = new LavalinkNode([...], cache);
using Lavalink4NET;
using Lavalink4NET.MemoryCache;
using Microsoft.Extensions.DependencyInjection;
var collection = new ServiceCollection()
.AddSingleton<ILavalinkCache, LavalinkCache>() // <--
.AddSingleton<IAudioService, LavalinkNode>()
.AddSingleton<IDiscordClientWrapper, ...>()
.BuildServiceProvider();