【问题标题】:azure redis cache key value concernsazure redis 缓存键值问题
【发布时间】:2016-03-08 13:48:36
【问题描述】:

我有一个场景,我的 azure redis 缓存键是唯一的。我倾向于使用由"<tenant guid>-<user guid>-<audience uri>-<issued at unix epoc time>" 组成的值,例如

cacheId = "90ebc5d3-7129-4a12-aabb-9f6ba00e47b5-58355802-a2e4-4b4c8ce1-df979ac4e8dc-http://targetresource.com/-1454185279"

对于使用这种格式或长度的 azure redis 缓存键是否会产生问题有任何想法吗?

cache.StringSet(cacheId, jwt, timeSpanOfNowUntilJwtExpiresEpocTime);  
. . .   
var userIdTokenCache = cache.StringGet(cacheId);  
if (userIdTokenCache.HasValue) { . . . } else { . . . }

【问题讨论】:

  • YMMV,但this unofficial benchmarking 显示在低于 10k 字符 KEY 时没有/最小的 write 性能下降,并且在低于 100 字符 KEY 时几乎没有 read 性能下降。所以,那应该完全没问题。

标签: azure-redis-cache


【解决方案1】:

我已经实现了这个,到目前为止还没有出现任何问题,所以看起来 redis 缓存可以使用这种格式和长度的缓存键。

【讨论】:

    猜你喜欢
    • 2014-10-05
    • 2015-11-27
    • 2016-09-10
    • 2019-05-17
    • 1970-01-01
    • 2016-06-04
    • 1970-01-01
    • 1970-01-01
    • 2021-01-24
    相关资源
    最近更新 更多