AddDistributedSqlServerCache registers an IDistributedCache implementation backed by SQL Server. Unlike in-process distributed memory caching, it lets multiple ASP.NET Core servers share entries and preserves them when the application stops. section 17.2.2
Register the persistent cache
builder.Services.AddDistributedSqlServerCache(opts => { opts.ConnectionString = builder.Configuration["ConnectionStrings:CacheConnection"]; opts.SchemaName = "dbo"; opts.TableName = "DataCache"; });
