When we try to use ProtobufSerializer with GetSet method the library throws the exception "The magic number in Gzip header is not correct"
this is an example
using IntelligentHack.IntelligentCache;
using ProtoBuf;
using StackExchange.Redis;
using System;
namespace RedisCacheSample
{
class Program
{
static void Main(string[] args)
{
var redisCache = new RedisCache(ConnectionMultiplexer.Connect("redis_cns"), "rd") { Serializer = new ProtobufSerializer()};
redisCache.GetSet("Key1", () => new Entity { Prop1="test" }, TimeSpan.FromMinutes(1));
var secondTime = redisCache.GetSet("Key1", () => new Entity { Prop1="test" }, TimeSpan.FromMinutes(1));
}
}
[ProtoContract]
public class Entity
{
[ProtoMember(1)]
public string Prop1 { get; set; }
}
}
the problem occurred when the entity is on redis and not the first time.
PR #28 is a possible fix
When we try to use ProtobufSerializer with GetSet method the library throws the exception "The magic number in Gzip header is not correct"
this is an example
the problem occurred when the entity is on redis and not the first time. PR #28 is a possible fix