把XSLT放入缓存里面

if(ApplicationGlobal.CacheXslt)
            {
                xsl = (XslTransform)(HttpContext.Current.Cache[xslFile]);
            }
            if(xsl == null)
            {
                xsl = new XslTransform();
                xsl.Load(StringUtil.ParseFileName(xslFile));
                HttpContext.Current.Cache.Insert(xslFile, xsl,
                    new System.Web.Caching.CacheDependency(xslFile),
                    DateTime.MaxValue, TimeSpan.FromHours(2));
            }
原文地址:https://www.cnblogs.com/chinatefl/p/272078.html