public async Task <IActionResult> Index(string Id = null) { string frase = null; if (!string.IsNullOrWhiteSpace(Id)) { byte[] fraseZip = null; var mcKey = $"surl_{Id}"; if (_memoryCache.TryGetValue(mcKey, out fraseZip)) { frase = TextUtilities.Unzip(fraseZip); await StorageClient.SaveShorten(Id, frase); _memoryCache.Remove(mcKey); } else { frase = await StorageClient.GetForShorten(Id); } } if (frase == null) { frase = ObtenerFrase(); } else { ViewBag.Surl = Id; } ViewBag.FraseShort = System.Convert.ToBase64String(TextUtilities.Zip(frase)); ViewBag.Frase = frase; return(View()); }