E
eBob.com
I thought I might save some time in a web application by caching some files
which are not likely to change very often. But I am wondering when the file
is actually fetched. Does anyone know when the bytes of the file are
actually transmitted in the sequence of statements below?
1) Dim URL As String = "http://path.jpg"
2) wrq = WebRequest.Create(URL)
3) wrp = DirectCast(wrq.GetResponse(), HttpWebResponse)
4) MsgBox("LastModified: " & wrp.LastModified)
5) MsgBox("ContentLength: " & wrp.ContentLength)
6) Dim sr As New StreamReader(wrp.GetResponseStream,
Encoding.GetEncoding(1252))
7) FileBytes = sr.ReadToEnd()
There's no point in keeping a cache if the bytes are actually transmitted
during the execution of line 3.
Thanks, Bob
which are not likely to change very often. But I am wondering when the file
is actually fetched. Does anyone know when the bytes of the file are
actually transmitted in the sequence of statements below?
1) Dim URL As String = "http://path.jpg"
2) wrq = WebRequest.Create(URL)
3) wrp = DirectCast(wrq.GetResponse(), HttpWebResponse)
4) MsgBox("LastModified: " & wrp.LastModified)
5) MsgBox("ContentLength: " & wrp.ContentLength)
6) Dim sr As New StreamReader(wrp.GetResponseStream,
Encoding.GetEncoding(1252))
7) FileBytes = sr.ReadToEnd()
There's no point in keeping a cache if the bytes are actually transmitted
during the execution of line 3.
Thanks, Bob