<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head><meta forua="true" http-equiv="Cache-Control" content="max-age=0" /></head>
<card title="asp文件缓存代码，使程序从缓存读数据" id="card1">
<p> 游客</p><p>
标题:asp文件缓存代码，使程序从缓存读数据<br/>
正文:<br/>
昨天测试了读出6000条新闻，读数据库用了23579毫秒，读文件只用了123毫秒，所以找了个文件缓存的代码，感兴趣的朋友可以研究下，有问题请反馈使用方法，在需要使用文件缓存的页面加入下列代码，&amp;lt;!--#include file=&amp;quot;FileCatch.asp&amp;quot; --&amp;gt;&amp;lt;%Set MyCatch=new CatchFileMyCatch.Overdue=10     '修改过期时间设置为10分钟if MyCatch.CatchNow(Rev) then        response.write MyCatch.CatchData        response.endend ifset MyCatch=nothing%&amp;gt;FileCatch.asp&amp;lt;%'---- 本文件用于签入原始文件，实现对页面的文件Catch'---- 1、如果文件请求为POST方式，则取消此功能'---- 2、文件的请求不能包含系统的识别关键字'---- 3、作者 何直群 (www.wozhai.com)Class CatchFile        Public Overdue,Mark,CFolder,CFile '定义系统参数        Private ScriptName,ScriptPath,ServerHost '定义服务器/页面参数变量        Public CatchData        '输出的数据        Private Sub Class_Initialize        '初始化函数             <br/><a href="http://www.xmhjfb.com/wap.asp?mode=WAP&amp;act=View&amp;id=49&amp;Page=1">[&lt;&lt;]</a><a href="http://www.xmhjfb.com/wap.asp?mode=WAP&amp;act=View&amp;id=49&amp;Page=1">[[1]]</a><a href="http://www.xmhjfb.com/wap.asp?mode=WAP&amp;act=View&amp;id=49&amp;Page=2">[2]</a><a href="http://www.xmhjfb.com/wap.asp?mode=WAP&amp;act=View&amp;id=49&amp;Page=3">[3]</a><a href="http://www.xmhjfb.com/wap.asp?mode=WAP&amp;act=View&amp;id=49&amp;Page=18">[&gt;&gt;]</a><br/>
<br/>
<a href="wap.asp?act=Com&amp;id=49">查看评论(0)</a><br/>
<a href="wap.asp?act=AddCom&amp;inpId=49">发表评论</a><br/><br/>

<br/>

<br/>
<a href="http://www.xmhjfb.com/wap.asp">首页</a>
</p>
</card>
</wml>