iT邦幫忙

0

cache key 、method parameter use jwt (JsonWebToken、C#)

deh 2021-08-18 16:15:58597 瀏覽
  • 分享至 

  • xImage

各位前輩好:
目前用lazyCache來做jwt的白名單

lazyCache.Add(jwt, userId)

key使用jwt,value用userId
其他method也會用到jwt當參數,舉例如下

public static string GetUserId(string jwt)
{
    return lazyCache.GetOrAdd(jwt, () => "");
}

想請問cache key、method parameter使用jwt,除了長度會占用較多記憶體之外,還會有什麼不良影響嗎?

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答