Skip to content

Commit

Permalink
It helps if you don't serialize strings...
Browse files Browse the repository at this point in the history
  • Loading branch information
Plootie committed May 15, 2024
1 parent 851778b commit 9f36fe7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SIT.Manager/Services/Caching/OnDiskCachingProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public override bool Add<T>(string key, T value, TimeSpan? expiryTime = null)
{
buffer = value as byte[] ?? [];
}
else if(typeof(T) == typeof(string))
{
buffer = Encoding.UTF8.GetBytes(value.ToString() ?? string.Empty);
}
else
{
string serializedData = JsonSerializer.Serialize(value);
Expand Down

0 comments on commit 9f36fe7

Please sign in to comment.