Beispiel #1
0
        public ActionResult Index()
        {
            int counterValue = AppStateHelper.IncrementAndGet(AppStateKeys.IndexCounter);

            Debug.WriteLine($"IndexCounter: {counterValue}");
            return(View((object)counterValue));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }