Beispiel #1
0
        /// <summary>
        /// 尝试获取缓存的输出
        /// </summary>
        /// <returns>缓存的输出</returns>
        protected virtual ICachedResponse ResolveCache(string virtualPath)
        {
            var policy = HtmlServices.GetCachePolicy(HttpContext);

            if (policy == null)
            {
                return(null);
            }


            CachePolicy = policy;

            var clientCachePolicy = policy as IClientCacheablePolicy;

            if (clientCachePolicy != null)
            {
                var response = clientCachePolicy.ResolveClientCache();
                if (response != null)
                {
                    return(response);
                }
            }

            return(CachePolicy.ResolveCache());
        }
Beispiel #2
0
 public CachePolicy CreateCachePolicy(HttpContextBase context)
 {
     return(HtmlServices.GetCachePolicy(context));
 }