Exemplo n.º 1
0
        private void LoadCache()
        {
            if (HttpContext.Cache[SiteConfig.BannerCache] == null)
            {
                CacheHelper.CacheBanner();
            }
            if (HttpContext.Cache[SiteConfig.HotNewsCache] == null)
            {
                CacheHelper.CacheHotNews();
            }
            if (HttpContext.Cache[SiteConfig.CustomerCache] == null)
            {
                CacheHelper.CacheCustomer();
            }
            if (HttpContext.Cache[SiteConfig.ServicePagesCache] == null)
            {
                CacheHelper.CacheServicesInfo();
            }

            ViewBag.Banners      = HttpContext.Cache.Get(SiteConfig.BannerCache);
            ViewBag.Customers    = HttpContext.Cache.Get(SiteConfig.CustomerCache);
            ViewBag.News         = HttpContext.Cache.Get(SiteConfig.HotNewsCache);
            ViewBag.ServicePages = HttpContext.Cache.Get(SiteConfig.ServicePagesCache);
        }