白桦的天空

第一次的心动,永远的心痛!
  首页  :: 新随笔  :: 联系 :: 管理

把XSLT放入缓存里面

Posted on 2005-11-09 10:08  白桦的天空  阅读(176)  评论(0编辑  收藏  举报
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));
            }