Exemplo n.º 1
0
        public ActionResult Index()
        {
            int counterValue = AppStateHelper.IncrementAndGet(AppStateKeys.IndexCounter);

            Debug.WriteLine($"IndexCounter: {counterValue}");
            return(View((object)counterValue));
        }
Exemplo n.º 2
0
        public ActionResult Index(string name, string city)
        {
            int counterValue = AppStateHelper.IncrementAndGet(AppStateKeys.IndexCounter);

            Debug.WriteLine($"IndexCounter: {counterValue}");
            return(View("~/Views/Shared/One.cshtml", (object)counterValue));
        }
        public ActionResult Index()
        {
            int counterValue = AppStateHelper.IncrementAndGet(AppStateKeys.IndexCounter);

            Debug.WriteLine($"IndexCounter: {counterValue}");
            return(View("~/Views/CachingChildAction/Index.cshtml", (object)counterValue));
        }
Exemplo n.º 4
0
        public ActionResult Index()
        {
            cacheSettingsHelper.DetectConfiguration(Request.RawUrl, Response.Cache);

            int counterValue = AppStateHelper.IncrementAndGet(AppStateKeys.IndexCounter);

            Debug.WriteLine($"IndexCounter: {counterValue}");
            return(View("~/Views/CachingChildAction/Index.cshtml", (object)counterValue));
        }
Exemplo n.º 5
0
        public ActionResult Index()
        {
            Response.Cache.SetExpires(DateTime.Now.AddSeconds(30));
            Response.Cache.SetCacheability(HttpCacheability.Server);
            Response.Cache.AddValidationCallback(CheckCachedItem, Request.UserAgent);

            Thread.Sleep(1000);
            int counterValue = AppStateHelper.IncrementAndGet(
                AppStateKeys.INDEX_COUNTER);

            Debug.WriteLine(string.Format("INDEX_COUNTER: {0}", counterValue));
            return(View(counterValue));
        }