public virtual ActionResult Display(string id) { Guid uniqueId; if (Guid.TryParse(id, out uniqueId)) { using (var session = Config.Default.CreateSession()) { var media = new Medias(session).FindBy(UniquelyIdentifiables.Meta.UniqueId, uniqueId); if (media != null) { this.Response.Cache.SetCacheability(HttpCacheability.Public); this.Response.Cache.SetExpires(DateTime.Now.AddYears(1)); this.Response.Cache.SetValidUntilExpires(true); return this.File(media.Content, media.MediaType.Name); } } } return this.HttpNotFound("Media with unique id " + uniqueId + " not found."); }