缓存问题,可以这样变通处理,等候官方封装。
写一个内部函数mywritefile,如
Dim e = args(0)
Dim fl = args(1)
Dim fs As System.IO.FileStream = Nothing
fs = System.IO.File.Open(fl, System.IO.FileMode.Open)
Dim btFile As Byte() = New Byte(fs.Length - 1) {}
fs.Read(btFile, 0, Convert.ToInt32(fs.Length))
fs.Close()
e.Response.Headers("Cache-Control") = "max-age=3600" '缓存3600秒
Dim output = e.response.OutputStream
output.Write(btFile,0,btFile.Length)
output.Close()
e.Handled = True
在httprequest事件,写修改代码,如
Dim fl As String =ProjectPath & e.path
If filesys.FileExists(fl)
Dim idx As Integer = fl.LastIndexOf(".")
Dim ext As String = fl.SubString(idx)
Select Case ext
Case ".jpg",".gif",".png",".bmp",".wmf",".js",".css" ,".html",".htm"
e.AsyncExecute = True
Functions.AsyncExecute("mywritefile", e, fl)
Return
End Select
End If
https://blog.csdn.net/u012375924/article/details/82806617