Beispiel #1
0
        private void ProcessOutputCache(RequestContext requestContext)
        {
            if (HttpContext.Current == null)
            {
                return;
            }

            var user = requestContext.HttpContext.User;

            if (user == null || user.Identity.IsAuthenticated)
            {
                return;
            }

            ICacheManager cacheManager = RouteExtensions.ResolveService <ICacheManager>(requestContext.RouteData);

            if (adhereToConfig && !cacheManager.Enabled)
            {
                return;
            }

            var page = new OutputCachedPage(cacheManager.GetOutputCacheParameters());

            page.ProcessRequest(HttpContext.Current);
            cacheManager.AddCacheInvalidation(HttpContext.Current.Response);
        }
Beispiel #2
0
        public static void InitTheme(this ControllerContext context)
        {
            var page = context.RequestContext.CurrentPage <ContentItem>()
                       ?? RouteExtensions.ResolveService <IUrlParser>(context.RouteData).FindPath(context.HttpContext.Request["returnUrl"]).StopItem
                       ?? RouteExtensions.ResolveService <IUrlParser>(context.RouteData).FindPath(context.HttpContext.Request.AppRelativeCurrentExecutionFilePath).StopItem
                       ?? context.RequestContext.StartPage();

            InitTheme(context, page);
        }