ASP.NET Coreの分散キャッシュ
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
「[[マイクロソフト系技術情報 Wiki>http://techinfoofmicros...
-[[戻る>ASP.NET CoreのSession利用方法]]
* 目次 [#c145203e]
#contents
*概要 [#p414f41d]
昔で言う、[[StateServerやSQL Server>ASP.NET Session#d2e4d...
*詳細 [#ld66eff4]
**Redis [#a2f8eb2f]
Redisが一般的
***サンプル [#a91d47c9]
.NET Core 2.1以前のバージョンでは、AddDistributedRedisCac...
.NET Core 2.2以降のバージョンでは、AddStackExchangeRedisC...
-NuGet
--StackExchange.Redis
--Microsoft.Extensions.Caching.StackExchangeRedis
--Microsoft.AspNetCore.DataProtection.StackExchangeRedis
-コード
using StackExchange.Redis;
using Microsoft.AspNetCore.DataProtection;
...
var redis = ConnectionMultiplexer
.Connect(Environment.GetEnvironmentVariable("REDIS"));
services
.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "DataProtect...
services.AddStackExchangeRedisCache(option =>
{
option.Configuration = Environment
.GetEnvironmentVariable("REDIS");
option.InstanceName = "RedisInstance";
});
***config [#he29af8d]
Connectメソッドの引数はconfigで、ココに、以下のように、~
「,」区切りで、色々なオプションを設定可能であるもよう。
ConnectionMultiplexer connection =
ConnectionMultiplexer.Connect("endpoint,password=...
-参考
--Configuration | StackExchange.Redis~
https://stackexchange.github.io/StackExchange.Redis/Confi...
**[[データ保護>ASP.NET Coreのデータ保護]] [#vc64fd93]
-昔で言う、machine.config の machineKeyの話。
-[[前述のサンプル・コード>#a2f8eb2f]]のように、
--AddDataProtection()
--SetApplicationName()
--PersistKeysToStackExchangeRedis()
>を呼び出す。
*参考 [#ga7db276]
**Microsoft Docs [#cf9dc121]
-ASP.NET Core での分散キャッシュ~
https://docs.microsoft.com/ja-jp/aspnet/core/performance/...
**Medium [#x16d84e2]
-ASP.NET Core Distributed Session with Redis | by Luiz Ad...
https://medium.com/@LuizAdolphs/asp-net-core-distributed-...
-How to distribute Data Protection keys with an ASP.NET C...
https://medium.com/swlh/how-to-distribute-data-protection...
**銀の光と碧い空 [#baecc266]
-ASP.NET Core on Linux で Session Replication するにはNFS...
http://tech.tanaka733.net/entry/aspnet-core-in-linux-sess...
-ASP.NET Core で複数Webサーバーでセッションを共有するとき...
IDistributedCacheとIDataProtectionに注意しないといけない話~
http://tech.tanaka733.net/entry/session-sharing-in-aspnet...
----
Tags: [[:.NET開発]], [[:.NET Core]], [[:ASP.NET]], [[:ASP...
終了行:
「[[マイクロソフト系技術情報 Wiki>http://techinfoofmicros...
-[[戻る>ASP.NET CoreのSession利用方法]]
* 目次 [#c145203e]
#contents
*概要 [#p414f41d]
昔で言う、[[StateServerやSQL Server>ASP.NET Session#d2e4d...
*詳細 [#ld66eff4]
**Redis [#a2f8eb2f]
Redisが一般的
***サンプル [#a91d47c9]
.NET Core 2.1以前のバージョンでは、AddDistributedRedisCac...
.NET Core 2.2以降のバージョンでは、AddStackExchangeRedisC...
-NuGet
--StackExchange.Redis
--Microsoft.Extensions.Caching.StackExchangeRedis
--Microsoft.AspNetCore.DataProtection.StackExchangeRedis
-コード
using StackExchange.Redis;
using Microsoft.AspNetCore.DataProtection;
...
var redis = ConnectionMultiplexer
.Connect(Environment.GetEnvironmentVariable("REDIS"));
services
.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "DataProtect...
services.AddStackExchangeRedisCache(option =>
{
option.Configuration = Environment
.GetEnvironmentVariable("REDIS");
option.InstanceName = "RedisInstance";
});
***config [#he29af8d]
Connectメソッドの引数はconfigで、ココに、以下のように、~
「,」区切りで、色々なオプションを設定可能であるもよう。
ConnectionMultiplexer connection =
ConnectionMultiplexer.Connect("endpoint,password=...
-参考
--Configuration | StackExchange.Redis~
https://stackexchange.github.io/StackExchange.Redis/Confi...
**[[データ保護>ASP.NET Coreのデータ保護]] [#vc64fd93]
-昔で言う、machine.config の machineKeyの話。
-[[前述のサンプル・コード>#a2f8eb2f]]のように、
--AddDataProtection()
--SetApplicationName()
--PersistKeysToStackExchangeRedis()
>を呼び出す。
*参考 [#ga7db276]
**Microsoft Docs [#cf9dc121]
-ASP.NET Core での分散キャッシュ~
https://docs.microsoft.com/ja-jp/aspnet/core/performance/...
**Medium [#x16d84e2]
-ASP.NET Core Distributed Session with Redis | by Luiz Ad...
https://medium.com/@LuizAdolphs/asp-net-core-distributed-...
-How to distribute Data Protection keys with an ASP.NET C...
https://medium.com/swlh/how-to-distribute-data-protection...
**銀の光と碧い空 [#baecc266]
-ASP.NET Core on Linux で Session Replication するにはNFS...
http://tech.tanaka733.net/entry/aspnet-core-in-linux-sess...
-ASP.NET Core で複数Webサーバーでセッションを共有するとき...
IDistributedCacheとIDataProtectionに注意しないといけない話~
http://tech.tanaka733.net/entry/session-sharing-in-aspnet...
----
Tags: [[:.NET開発]], [[:.NET Core]], [[:ASP.NET]], [[:ASP...
ページ名: