Browse Source

Backport the caching changes to OpenIddict 1.x

pull/670/head
Kévin Chalet 8 years ago
parent
commit
55f8e2d1f7
  1. 12
      src/OpenIddict.Stores/Stores/OpenIddictApplicationStore.cs
  2. 4
      src/OpenIddict.Stores/Stores/OpenIddictScopeStore.cs

12
src/OpenIddict.Stores/Stores/OpenIddictApplicationStore.cs

@ -393,9 +393,7 @@ namespace OpenIddict.Stores
// Note: parsing the stringified permissions is an expensive operation.
// To mitigate that, the resulting array is stored in the memory cache.
var key = string.Concat(nameof(GetPermissionsAsync), "\x1e", application.Permissions);
var permissions = Cache.GetOrCreate(key, entry =>
var permissions = Cache.GetOrCreate("0347e0aa-3a26-410a-97e8-a83bdeb21a1f", entry =>
{
entry.SetPriority(CacheItemPriority.High)
.SetSlidingExpiration(TimeSpan.FromMinutes(1));
@ -431,9 +429,7 @@ namespace OpenIddict.Stores
// Note: parsing the stringified addresses is an expensive operation.
// To mitigate that, the resulting array is stored in the memory cache.
var key = string.Concat(nameof(GetPostLogoutRedirectUrisAsync), "\x1e", application.PostLogoutRedirectUris);
var addresses = Cache.GetOrCreate(key, entry =>
var addresses = Cache.GetOrCreate("fb14dfb9-9216-4b77-bfa9-7e85f8201ff4", entry =>
{
entry.SetPriority(CacheItemPriority.High)
.SetSlidingExpiration(TimeSpan.FromMinutes(1));
@ -493,9 +489,7 @@ namespace OpenIddict.Stores
// Note: parsing the stringified addresses is an expensive operation.
// To mitigate that, the resulting array is stored in the memory cache.
var key = string.Concat(nameof(GetRedirectUrisAsync), "\x1e", application.RedirectUris);
var addresses = Cache.GetOrCreate(key, entry =>
var addresses = Cache.GetOrCreate("851d6f08-2ee0-4452-bbe5-ab864611ecaa", entry =>
{
entry.SetPriority(CacheItemPriority.High)
.SetSlidingExpiration(TimeSpan.FromMinutes(1));

4
src/OpenIddict.Stores/Stores/OpenIddictScopeStore.cs

@ -302,9 +302,7 @@ namespace OpenIddict.Stores
// Note: parsing the stringified resources is an expensive operation.
// To mitigate that, the resulting array is stored in the memory cache.
var key = string.Concat(nameof(GetResourcesAsync), "\x1e", scope.Resources);
var resources = Cache.GetOrCreate(key, entry =>
var resources = Cache.GetOrCreate("b6148250-aede-4fb9-a621-07c9bcf238c3", entry =>
{
entry.SetPriority(CacheItemPriority.High)
.SetSlidingExpiration(TimeSpan.FromMinutes(1));

Loading…
Cancel
Save