private byte[] SerializeAndZip <TResult>(MemcachedObject <TResult> item)
        {
            using (var ms = new MemoryStream())
            {
                using (var compressionStream = new GZipStream(ms, CompressionMode.Compress))
                {
                    using (var zipStreamWriter = new StreamWriter(compressionStream))
                    {
                        _serializer.Serialize(zipStreamWriter, item);
                    }
                }

                return(ms.ToArray());
            }
        }
        public async Task StoreAsync <TResult>(ProxiedMethodInvocation <T, TResult> proxiedMethodInvocation, CachePolicy cachePolicy, TResult data)
        {
            var key          = proxiedMethodInvocation.GetHashString(_hashScramble);
            var cachedObject = new MemcachedObject <TResult>()
            {
                Created = DateTime.Now,
                Object  = data
            };

            var bytes = SerializeAndZip(cachedObject);

            if (cachePolicy.MaxAge > 0)
            {
                await _memcachedCluster.Set(key, bytes, new MemcachedStorageOptions()
                {
                    ExpirationTime = TimeSpan.FromSeconds(cachePolicy.MaxAge)
                });
            }
            else
            {
                await _memcachedCluster.Set(key, bytes);
            }
        }