Пример #1
0
        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);
        }
Пример #2
0
 public static void InvalidateCacheItem(string item)
 {
     GxSmartCacheProvider.Invalidate(item);
 }
Пример #3
0
 public static void InvalidateCache()
 {
     GxSmartCacheProvider.InvalidateAll();
 }