动态网页,如何不缓存页面
- HTML code
<% Response.Buffer = True Response.ExpiresAbsolute = Now() - 1 Response.Expires = 0 %><% web=request.Form("selname2")webs=split(web,",")%><%Dim paths,fso,objFolder,file,foldFiles,mmurl = "/fujitec1/" paths="imagin/" & webs(0) & "/" &webs(1) '图片文件所在的文件夹Set fso=Server.CreateObject("Scripting.FileSystemObject")Set objFolder = fso.GetFolder(Server.MapPath(paths))Set foldFiles = objFolder.filesi=1For Each file In foldFilesimagin=split(file,"\")files=imagin(ubound(imagin))urls=url &"/" &paths & "/" & filesresponse.write "<td><a href='"&urls&"'>"&files&"<br><br></td>"NextSet objFolder=nothingSet objSubFolders=nothingSet foldFiles=nothingSet fso=nothing%>上面的代码是读取文件夹下的图片,现在问题是当我改动图片(小改动时),
第二次打开时还是缓存里的图片,如何解决这个问题了,谢谢。
[解决办法]
使用random生成随机数加在url中试试
[解决办法]
<meta http-equiv="expires" content="0">
[解决办法]
meta不知道放在哪??
放在
<head>
<meta>
<title>
[解决办法]
提交页面的时候,挂个时间参数.
比如 a.asp?t=<%=now()%>
[解决办法]
正常情况不需要加任何代码的,输出页面只要与之前不同,就不会读取缓存的。asp动态元素更是如此。
实在不行试下10楼的方法。