I am trying to read a file located at some http address, but I am stuck with this problem: once received a content, on subsequent connection I get always the same content even if the file was changed. I suppose it is Internet cache, but it seems impossible to clear it. In Windows I am trying this command:
var s as shell
s.execute “RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255”
but it does’nt work.
How to solve it? And when in future I will compile for Mac, could i have the same problem?
Not sure if this will work or get the cached version, but I use this Method based on the Forum post(forum.xojo.com/22982-get-line-1-from-external-file-located-on-internet/0#p193920):
Protected Function getHTTPFolderItem(webSiteURL As String, f As FolderItem, timeOut As Integer = 20) As FolderItem #If TargetDesktop Or TargetWeb Then 'iOS has no HTTPSocket, so needs to be changed to URLConnection Var tempHTTPSocket As New HTTPSocket Var tempBoolean As Boolean = False If webSiteURL = "" Or f = Nil Or Not f.Parent.Exists Then Return Nil If webSiteURL.Left(7) <> "http://" And webSiteURL.Left(8) <> "https://" Then 'ensure the URL prefix is correct webSiteURL = "http://" + webSiteURL End If tempBoolean = tempHTTPSocket.Get(webSiteURL, f, timeOut) If tempBoolean And f <> Nil And f.Exists And tempHTTPSocket.ErrorCode = 0 Then tempHTTPSocket.Close Return f Else tempHTTPSocket.Close Return Nil End If #EndIf End Function
Doesn’t one throw a nonce on the end as a URL parameter to make it certain ?
Based on UNIX ts for example.
Thank you very much David, your hint was really helpful. This very simple code, based on the Forum post you quoted, worked:
dim s as String
dim url as string =
dim dl as new HTTPSocket
s = (dl.get (url, 100))
(then I can process the string as I like)
I’m not so expert, but I guess that URLConnection and HTMLViewer are based on the default system browser (IE), so they are affected by its cache; HTTP Socket seems to bypass it, isn’it?
However, how to get the same result with iOs if there is no HTTP Socket for Mac? I don’t know Mac, I just would like to implement my program also there. I read that iOs wants secure “https” only, and that to read “http” URLs some stuff in a plist file should be done. But I am lost, don’t know details about how a package for Mac should be done from scratch… I did’nt find a clear and complete tutorial, is there one somewhere?
Thank you again, A.