![](/img/trans.png)
[英]ASP.NET Core Converting In-Memory Cache with IMemoryCache to Redis
[英]Can I use In-Memory Engine for SQL Server Distributed Cache in ASP.NET Core?
我目前在 ASP.NET 核心中使用分布式 SQL 服務器緩存。
分布式 SQL 服務器緩存實現 ( AddDistributedSqlServerCache
) 允許分布式緩存使用 SQL 服務器數據庫作為其后備存儲。
有關文檔,請單擊此處
我使用了以下方法:
services.AddDistributedSqlServerCache(options =>
{
options.ConnectionString =
_config["DistCache_ConnectionString"];
options.SchemaName = "dbo";
options.TableName = "MyDiskBasedTable";
});
我可以使用AddDostributedSqlServerCache
實現創建數據庫對象,以便使用內存引擎(內存表、本機編譯存儲過程、內存優化表類型)獲得最佳性能嗎?
由dotnet sql-cache create
的表有一個clusterd primary key
,並且使用datetimeoffset
兩者在創建內存中 OLTP 表時都不受支持。
雖然在存儲庫中有一個PR 。
您可以使用他的 fork,盡管不推薦將datetimeoffest
保存為varchar
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.