0
votes

I have a scenario where for my azure redis cache key to be unique. I'm inclined to use a value consisting of "<tenant guid>-<user guid>-<audience uri>-<issued at unix epoc time>", e.g.

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

Any thoughts on whether or not use of an azure redis cache key of this format or length will create issues?

cache.StringSet(cacheId, jwt, timeSpanOfNowUntilJwtExpiresEpocTime);  
. . .   
var userIdTokenCache = cache.StringGet(cacheId);  
if (userIdTokenCache.HasValue) { . . . } else { . . . }
1
YMMV, but this unofficial benchmarking shows no/minimal write performance degradation below 10k-character KEY, and little to no read degradation below 100-character KEY. So, that should be totally fine.dwanderson

1 Answers

0
votes

I've implemented this and so far no issues surfaced so it would appear redis cache is okay with cache keys of this format and length.