NVelocity怎么设置模版缓存的呢?

 

//props.AddProperty(RuntimeConstants.FILE_RESOURCE_LOADER_CACHE, true);
//props.AddProperty("file.resource.loader.modificationCheckInterval", (Int32)30);

 

 

这样设置缓存吗?那要怎么从缓存中读取呢?

 

if (HttpContext.Current.Cache["file.resource.loader.cache"] != null)
props.AddProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, HttpContext.Current.Cache[
"file.resource.loader.cache"].ToString());
else
props.AddProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, templetepath);

 

 

这样读取吗?还是设置了后它会直接从缓存中读取?

网上这资料好少!希望大家帮帮忙!

临摹微笑
浏览 326回答 1
1回答

江户川乱折腾

直接内部读取的
打开App,查看更多内容
随时随地看视频慕课网APP