我用dnn开发的网站,网页显示很慢, 在DNN模块开发中如何利用缓存,以提高系统性能,
请用实例说明
请用实例说明
解决方案 »
- 下面一段代码在windowmobile上运行正常,在winform上运行失败,求解!
- 求《Head First C#》
- c# IHTMLElement对象如何绑定js onclick事件
- 如何用c#获得这个网站的源码?
- WINFROM控件共用的问题……
- 关于通信的一个问题!100分
- 在c#中,用txt文本做数据库行吗?
- 两个DataTable联合后,如何对数据排序?
- C# 快速将DataTable中日期列的同一个月的数据提取出来
- DataSet 的Update()! 我今天喝了点酒,本来这个问题我都不敢在问了!
- 寻求文本编辑器控件,要求有比较好的编辑排版功能
- 十万火急Log4net 程序中配置数据库连接,项目紧急,感谢各位。。。
//将页面加载到缓存
GetEntryInfo(ByVal entryID As Integer) As EntryInfo
Dim strCacheKey As String = ConfigManager.ENTRYINFO_CACHEKEY_PREFIX & CStr(entryID)
Dim entry As EntryInfo = CType(DataCache.GetCache(strCacheKey), EntryInfo) If entry Is Nothing Then entry = EntryController.GetEntry(entryID)
If Not entry Is Nothing Then DataCache.SetCache(strCacheKey, entry)
End If End If Return entry
End Function
//同时需要在更新该帖子时(编辑或删除)清除缓存://Resets the cached entry to nothingPublic Shared Sub ResetEntryInfo(ByVal entryID As Integer)
Dim strCacheKey As String = ConfigManager.ENTRYINFO_CACHEKEY_PREFIX & CStr(entryID)
DataCache.RemoveCache(strCacheKey)
End Sub' for example: delete entryPublic Shared Sub DeleteEntry(ByVal entryID As Integer)
DataService.DeleteEntry(entryID)
' Refresh cache ResetEntryInfo(entryID)
End Sub转载地址: http://www.dnnsun.com