CacheManager
CacheManager copied to clipboard
Does CacheManager.Serialization.Json.GzJsonCacheSerializer support string values?
Here is my cache configuration
cacheConfigBuilder
.WithRedisConfiguration("redis", redisConnection.Value)
.WithUpdateMode(CacheUpdateMode.Up)
.WithSerializer(typeof(CacheManager.Serialization.Json.GzJsonCacheSerializer))
.WithMaxRetries(1)
.WithRetryTimeout(2)
.WithRedisBackplane("redis", channelName: $"{environment.EnvironmentName}-backplane")
.WithRedisCacheHandle("redis", isBackplaneSource: true);
When I put string into the cache it seems it is not compressed.
Yeah, primitives do not have to be serialized, that's why a string doesn't go through the serializer/gz compression. You could easily do that yourself though and just cache the compressed byte array?
I just wrapped a sting into a custom object. Maybe this could be mentioned in the documentation http://cachemanager.michaco.net/documentation/CacheManagerSerialization?
Yup, documentation should probably have a statement about that