 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
David Ayre Guest
|
Posted: Tue Aug 01, 2006 3:52 pm Post subject: Strange behaviour of Indy http |
|
|
Hi I am using Indy 9 with BDS2006 and have developed an http
routine to do an automatic download of an update file from my
website. Basically, it seemed to work fine until I replaced the
update file on the website with a newer version.
Now when I run my application, it downloads the file from the
website, but when I look at it, it is the previous version. I'm
sure the one on the website is the new one, but after downloading,
I have the old one.
Any ideas?
David |
|
| Back to top |
|
 |
Bob Gonder Guest
|
Posted: Tue Aug 01, 2006 6:50 pm Post subject: Re: Strange behaviour of Indy http |
|
|
David Ayre wrote:
| Quote: | Now when I run my application, it downloads the file from the
website, but when I look at it, it is the previous version. I'm
sure the one on the website is the new one, but after downloading,
I have the old one.
Any ideas?
|
<Part A:Human error>
First, make sure you uploaded the correct version.
</Part A>
<Part B: Program failures>
Did you delete the old one before downloading the new one?
Do you download to a different name, then swap new/old (and fail)?
Did you actually download to the folder you thought you were sending
it to?
</Part B>
<Part C:Web failures>
Is your web site cached somewhere? Do you also update an html at the
site, and does it show up properly with the user's browser going to
your site?
</Part C> |
|
| Back to top |
|
 |
David Ayre Guest
|
Posted: Tue Aug 01, 2006 7:14 pm Post subject: Re: Strange behaviour of Indy http |
|
|
Bob Gonder <notbg (AT) notmindspring (DOT) invalid> wrote:
| Quote: | David Ayre wrote:
Now when I run my application, it downloads the file from the
website, but when I look at it, it is the previous version. I'm
sure the one on the website is the new one, but after downloading,
I have the old one.
Any ideas?
Part A:Human error
First, make sure you uploaded the correct version.
/Part A
|
Yes. I checked this several times and if I download using ftp
then it is correct.
| Quote: | Part B: Program failures
Did you delete the old one before downloading the new one?
Do you download to a different name, then swap new/old (and fail)?
Did you actually download to the folder you thought you were sending
it to?
|
I deleted the old file before uploading the new one. I am happy
that the website holds the new file and that the webserver
doesn't cash the files.
| Quote: | /Part B
Part C:Web failures
Is your web site cached somewhere? Do you also update an html at the
site, and does it show up properly with the user's browser going to
your site?
/Part C
|
All I can think is that the Indy HTTP component is cashing the
file somewhere and using the old one instead of downloading the
new one, but I don't know how to overcome this.
Cheers,
David |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Aug 02, 2006 1:25 am Post subject: Re: Strange behaviour of Indy http |
|
|
"David Ayre" <davidcayre (AT) ntlworld (DOT) com> wrote in message
news:44cf61e0$1 (AT) newsgroups (DOT) borland.com...
| Quote: | All I can think is that the Indy HTTP component is cashing
the file somewhere
|
TIdHTTP does not perform any kind of caching at all. It retrieves whatever
the server provides. If you are receiving an old file, then the server
itself (or a proxy in between) is performing caching on its end. There is
nothing TIdHTTP can do to prevent that. What it can do, however, is request
a non-cached version of the file, by setting the Request->Pragma property to
"no-cache" before calling Get().
Gambit |
|
| Back to top |
|
 |
David Ayre Guest
|
Posted: Wed Aug 02, 2006 1:19 pm Post subject: Re: Strange behaviour of Indy http |
|
|
| Quote: | TIdHTTP does not perform any kind of caching at all. It retrieves whatever
the server provides. If you are receiving an old file, then the server
itself (or a proxy in between) is performing caching on its end. There is
nothing TIdHTTP can do to prevent that. What it can do, however, is request
a non-cached version of the file, by setting the Request->Pragma property to
"no-cache" before calling Get().
Gambit
Thanks Remy, but I have tried that and I still get the old |
version of the file. I inserted this line before the Get():-
IdHTTP1->Request->Pragma = "no-cache";
I also tried inserting "no-cache" into the Request->Pragma slot
in the object inspector for IdHTTP1 but all to no avail.
I assume from this that I'll have to have a word with the website
host.
Thanks anyway,
David |
|
| Back to top |
|
 |
Bob Gonder Guest
|
Posted: Wed Aug 02, 2006 11:07 pm Post subject: Re: Strange behaviour of Indy http |
|
|
David Ayre wrote:
| Quote: | I deleted the old file before uploading the new one.
|
Ok, but did you also delete the old file before downloading the new
one with TIdHTTP? |
|
| Back to top |
|
 |
David Ayre Guest
|
Posted: Thu Aug 03, 2006 1:14 pm Post subject: Re: Strange behaviour of Indy http |
|
|
Bob Gonder <notbg (AT) notmindspring (DOT) invalid> wrote:
| Quote: | David Ayre wrote:
I deleted the old file before uploading the new one.
Ok, but did you also delete the old file before downloading the new
one with TIdHTTP?
If you mean 'did I delete the old file from my computer before |
downloading the new one', the answer is yes. I do that in the
application. Delete old file and then download new one, except
that it is always the old one that appears.
If I download the file using ftp, I get the new one.
I have also tried Remy's suggestion of setting
Request->Pragma = "no-cache";
But still it brings down the old file. I have asked the web host
about this but am still waiting for a reply.
Cheers,
David |
|
| Back to top |
|
 |
David Ayre Guest
|
Posted: Thu Aug 03, 2006 11:53 pm Post subject: Re: Strange behaviour of Indy http |
|
|
"David Ayre" <davidcayre (AT) ntlworld (DOT) com> wrote:
| Quote: |
Bob Gonder <notbg (AT) notmindspring (DOT) invalid> wrote:
David Ayre wrote:
I deleted the old file before uploading the new one.
Ok, but did you also delete the old file before downloading the new
one with TIdHTTP?
If you mean 'did I delete the old file from my computer before
downloading the new one', the answer is yes. I do that in the
application. Delete old file and then download new one, except
that it is always the old one that appears.
If I download the file using ftp, I get the new one.
I have also tried Remy's suggestion of setting
Request->Pragma = "no-cache";
But still it brings down the old file. I have asked the web host
about this but am still waiting for a reply.
Cheers,
David
I have since checked with the website host and there is no |
caching on the webserver. However, they suggest that the ISP
might be caching files. If this is the case, it would seem
that the Request->Pragma = "no-cache" doesn't work in this
situation.
I have also found that after a day, the new file is downloaded
so the cache must be purged after a day. I suppose I can live
with this, but it would be nice to be in control of the
situation.
Cheers,
David |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|