Beispiel #1
0
        private static void addPageCache(ProcessContext context, MvcContext ctx)
        {
            if (ctx.controller == null)
            {
                return;
            }
            if (ctx.IsMock)
            {
                return;
            }

            IPageCache pageCache = ControllerMeta.GetPageCache(ctx.controller.GetType(), ctx.route.action);

            if (pageCache == null)
            {
                return;
            }
            if (pageCache.IsCache(ctx) == false)
            {
                return;
            }

            String key = ctx.url.PathAndQuery;

            if (MvcConfig.Instance.CheckDomainMap())
            {
                key = ctx.url.ToString();
            }

            CacheManager.GetApplicationCache().Put(key, context.getContent());

            logger.Info("add page cache, key=" + key);
            pageCache.AfterCachePage(ctx);
        }