🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
8 messages
8 total messages Started by David Ayre Tue, 01 Aug 2006 10:52
Strange behaviour of Indy http
#2150
Author: David Ayre
Date: Tue, 01 Aug 2006 10:52
12 lines
1426 bytes
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
Re: Strange behaviour of Indy http
#2152
Author: Bob Gonder
Date: Tue, 01 Aug 2006 13:50
24 lines
1702 bytes
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>

<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>
Re: Strange behaviour of Indy http
#2153
Author: David Ayre
Date: Tue, 01 Aug 2006 14:14
42 lines
2239 bytes
Bob Gonder <notbg@notmindspring.invalid> wrote:
>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.

><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.

></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
Re: Strange behaviour of Indy http
#2156
Author: Remy Lebeau (TeamB)
Date: Tue, 01 Aug 2006 20:25
16 lines
1587 bytes
"David Ayre" <davidcayre@ntlworld.com> wrote in message
news:44cf61e0$1@newsgroups.borland.com...

> 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
Re: Strange behaviour of Indy http
#2157
Author: David Ayre
Date: Wed, 02 Aug 2006 08:19
23 lines
1833 bytes

>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
Re: Strange behaviour of Indy http
#2159
Author: Bob Gonder
Date: Wed, 02 Aug 2006 18:07
6 lines
1180 bytes
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?
Re: Strange behaviour of Indy http
#2164
Author: David Ayre
Date: Thu, 03 Aug 2006 08:14
22 lines
1755 bytes
Bob Gonder <notbg@notmindspring.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
Re: Strange behaviour of Indy http
#2165
Author: David Ayre
Date: Thu, 03 Aug 2006 18:53
38 lines
2416 bytes
"David Ayre" <davidcayre@ntlworld.com> wrote:
>
>Bob Gonder <notbg@notmindspring.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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads