public static async Task <T> GetObjectAsync <T>(this IDistributedCache cache, string key) where T : class
        {
            var json =
                await cache.GetAsync(key);

            if (json == null)
            {
                return(null);
            }

            var data = DataCompressor.Decompress(Encoding.UTF8.GetString(json));

            var storedObject = JsonConvert.DeserializeObject <T>(data, GetJsonSettings());

            return(storedObject);
        }