public bool ProcessHeaders(string queryId) { NameValueCollection headers = GetHeaders(); String language = null, theme = null, etag = null; if (headers != null) { language = headers["GeneXus-Language"]; theme = headers["GeneXus-Theme"]; if (!IsPost()) { etag = headers["If-Modified-Since"]; } } if (!string.IsNullOrEmpty(language)) { context.SetLanguage(language); } if (!string.IsNullOrEmpty(theme)) { context.SetTheme(theme); } DateTime dt = HTMLDateToDatetime(etag); DateTime newDt; DataUpdateStatus status; if (etag == null) { status = DataUpdateStatus.Invalid; GxSmartCacheProvider.CheckDataStatus(queryId, dt, out newDt); } else { status = GxSmartCacheProvider.CheckDataStatus(queryId, dt, out newDt); } AddHeader("Last-Modified", dateTimeToHTMLDate(newDt)); if (status == DataUpdateStatus.UpToDate) { SetStatusCode(HttpStatusCode.NotModified); return(false); } return(true); }
public static void InvalidateCacheItem(string item) { GxSmartCacheProvider.Invalidate(item); }
public static void InvalidateCache() { GxSmartCacheProvider.InvalidateAll(); }