fix: if cache get bytes then skip serealize
This commit is contained in:
Endpoint/Common/Services/Security
@ -17,7 +17,7 @@ public class DistributedCacheService(IDistributedCache cache) : ICacheService
|
||||
SlidingExpiration = slidingExpiration
|
||||
};
|
||||
|
||||
var serializedValue = JsonSerializer.SerializeToUtf8Bytes(value);
|
||||
var serializedValue = value as byte[] ?? JsonSerializer.SerializeToUtf8Bytes(value);
|
||||
await cache.SetAsync(key, serializedValue, options, cancellationToken);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user