public static void InsertETag(HttpResponseBase response, Model model) { try { var eTagValue = CalculateETag(model); if (!string.IsNullOrEmpty(eTagValue)) { var matchETagValue = HttpContext.Current.Request.Headers["If-None-Match"]; if (matchETagValue != null && matchETagValue == eTagValue) { response.SuppressContent = true; response.StatusCode = 304; response.StatusDescription = "Not Modified"; response.Headers["Content-Length"] = "0"; response.AppendHeader("ETag", eTagValue); } else { response.AppendHeader("ETag", eTagValue); } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)