lizandpedia
New Member
I have the following code:\[code\]var stack = new Stack<dynamic>();var node = CmsContext.Current.Node;if (node == null) { return; }var key = string.Format("{0}:Stack", node.VirtualPath());if (Settings.EnableCaching && HttpRuntime.Cache[key] != null){ Trace.Write("Retrieving stack from cache", "Test"); stack = HttpRuntime.Cache[key] as Stack<dynamic>;}else{ Trace.Write("Retrieving stack from database", "Test"); stack = node.Stack(); if (Settings.EnableCaching) { Trace.Write("Caching stack", "Test"); HttpRuntime.Cache.Insert(key, stack); }}\[/code\]And for some reason, the line:\[code\] stack = HttpRuntime.Cache[key] as Stack<dynamic>;\[/code\]returns a \[code\]stack\[/code\] object with 0 items. Any ideas?