Robert Valentino Well-Known Member Licensed User Longtime User Sep 27, 2016 #1 I am sure this bug / problem is related to my environment I use HttpJob to download a small file from my website. Works perfect (first time). If I change the file and upload it to my website and try the download again I am getting the old file. I am sure it is being cached somewhere and something is not noticing that the file on the website is different and giving me the old copy. I have tried clearing the cache in Setting -> Applications -> MyApp ( being my apps name ) I tried rebooting the device And still wrong. I have to wait until tomorrow or the next day before I can get the new file. If I change the file name then everything works again that one time. I use FatCow.com as a hosting agent I use Exede as my internet provider (only choice for me living in the middle of nowhere) My device is a Samsung Tablet Galaxy Tab 3 ANYONE have any ideas on how to always get the current file and not a cached one Thanks BobVal
I am sure this bug / problem is related to my environment I use HttpJob to download a small file from my website. Works perfect (first time). If I change the file and upload it to my website and try the download again I am getting the old file. I am sure it is being cached somewhere and something is not noticing that the file on the website is different and giving me the old copy. I have tried clearing the cache in Setting -> Applications -> MyApp ( being my apps name ) I tried rebooting the device And still wrong. I have to wait until tomorrow or the next day before I can get the new file. If I change the file name then everything works again that one time. I use FatCow.com as a hosting agent I use Exede as my internet provider (only choice for me living in the middle of nowhere) My device is a Samsung Tablet Galaxy Tab 3 ANYONE have any ideas on how to always get the current file and not a cached one Thanks BobVal
Pendrush Well-Known Member Licensed User Longtime User Sep 27, 2016 #2 Did you try to download same file with your desktop web browser and check it's new or "old" file? Upvote 0
Robert Valentino Well-Known Member Licensed User Longtime User Sep 28, 2016 #3 Interesting. As soon as I downloaded it using my PC browser then I was able to get it using my Android device. What does this mean? PS: Thanks so much Upvote 0
Interesting. As soon as I downloaded it using my PC browser then I was able to get it using my Android device. What does this mean? PS: Thanks so much
Pendrush Well-Known Member Licensed User Longtime User Sep 28, 2016 #4 Code: Copy Dim job1 As HttpJob job1.Initialize("Job1", Me) job1.Download("http://www.example.com/1.zip") 'add your path here job1.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0") Maybe User-Agent is source of the problem, by default OkHttp use this user agent: okhttp/2.4.0 Upvote 0
Code: Copy Dim job1 As HttpJob job1.Initialize("Job1", Me) job1.Download("http://www.example.com/1.zip") 'add your path here job1.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0") Maybe User-Agent is source of the problem, by default OkHttp use this user agent: okhttp/2.4.0
Erel B4X founder Staff member Licensed User Longtime User Sep 29, 2016 #5 Note that OkHttp doesn't cache anything. Try with: Code: Copy job1.Download("http://www.example.com/1.zip?dummy=" & DateTime.Now) Upvote 0
Note that OkHttp doesn't cache anything. Try with: Code: Copy job1.Download("http://www.example.com/1.zip?dummy=" & DateTime.Now)
Robert Valentino Well-Known Member Licensed User Longtime User Sep 29, 2016 #6 Tried Pendrush suggestion got a EOF error Will try what you suggest Erl. I believe this is probably an Exede problem (satellite server doing cache) reason I say this, is I do have this problem in Windows as well. For the time being, I just am using a different file name each time. Once testing is done file will be changing very little Thanks Upvote 0
Tried Pendrush suggestion got a EOF error Will try what you suggest Erl. I believe this is probably an Exede problem (satellite server doing cache) reason I say this, is I do have this problem in Windows as well. For the time being, I just am using a different file name each time. Once testing is done file will be changing very little Thanks
Robert Valentino Well-Known Member Licensed User Longtime User Oct 2, 2016 #7 Just got around to trying the "?dummy=" &DateTime.Now and this worked perfectly every time WHY? and Thanks Upvote 0
Just got around to trying the "?dummy=" &DateTime.Now and this worked perfectly every time WHY? and Thanks
Erel B4X founder Staff member Licensed User Longtime User Oct 2, 2016 #8 Robert Valentino said: WHY? Click to expand... Check the server configuration. It caches identical requests. Upvote 0
Robert Valentino said: WHY? Click to expand... Check the server configuration. It caches identical requests.