最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp提高首页性能的一个技巧
时间:2008-01-12 编辑:简简单单 来源:一聚教程网
最好让这个页和你要缓存的页在一个目录下,要不有些相对路径的图片就无法显示了,另外缓存有的页面会出现乱码,我还不知道怎么解决这个问题呢,可能在Response的时候需要设置一下编码类型,大家可以试试
<%
Dim wawa,StarTime,EndTime
StarTime=Timer()
Set wawa=new Cls_Cache
wawa.Reloadtime=0.5
wawa.CacheName="wawa"
wawa.Name="XmlInfoIndex"
If wawa.ObjIsEmpty() Then CacheXmlInfoIndex()
Response.Write wawa.value
EndTime=Timer()
Response.Write "
执行时间:" & FormatNumber((Endtime-StarTime)*1000,5) & "毫秒。"
Sub CacheXmlInfoIndex()
Dim BodyText, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
'把下面的地址替换成你的首页的文件地址,一定要用http://开头的绝对路径,不能写相对路径
xml.Open "GET", "http://onlytiancai/bak/vote/InfoIndex.asp", False
xml.Send
BodyText=xml.ResponseBody
BodyText=BytesToBstr(BodyText,"gb2312")
wawa.Value=BodyText
Set xml = Nothing
End Sub
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
-
上一个: 优化ASP程序
-
下一个: 如何监视和提高IIS 5.0的性能
相关文章
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- asp中获取日期为星期几的技巧 09-14
- Asp编码优化参考 09-14
- .Net Core认证系统源码解析 12-26
- SharePoint Server 2019新特性介绍 01-15