BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

odd behavior with Indy HTTP-- not getting most current text

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Bryan Ray
Guest





PostPosted: Tue Sep 16, 2003 7:08 pm    Post subject: odd behavior with Indy HTTP-- not getting most current text Reply with quote




Hello all,

I'm having a problem downloading a "current" text file that is updated on a regular basis. Here is the situation:

Using a Proxy server (no userID or password required... only proxy server and port.)
Indy version 9.00.10
Win 2000, and Win XP Pro
Internet Explorer 6.X (if it matters).

Code used to get the text file on the National Hurricane Center's server.
MyForm.FilterMemo.Lines.Text := Http1.Get('http://www.nhc.noaa.gov/ftp/pub/forecasts/marine/MIATCMAT3');

This code works fine most of the time.... but, on occasion, the downloaded file is not the current one. (i.e. I can take the above url and use Internet Explorer and get the current one, but through my application it occasionally is an old outdated file.

Possible causes????
- Maybe, I'm retrieving a cached copy of the file?? Is there some correlation between Indy and Internet Explorer file history (cached pages/files).
- Something to do with using a Proxy server? I'm think probably not.
If I close my app and restart, I still get the same effect after restarting.

Now here is the odd behavior: My app will try to get the lates file above (url above) based on a timer. The "current" file will be downloaded eventually (usually 1 hour after the current file is posted (url above)). That 1 hour window is what's killing me. Like I said, this only happens on occasion (probably 1 out of 5 times). Could there be an issue with the target server? Maybe file expiration times.....?

Thanks for any suggestions you may have.
Bryan
Back to top
Grahame Grieve
Guest





PostPosted: Tue Sep 16, 2003 9:05 pm    Post subject: Re: odd behavior with Indy HTTP-- not getting most current t Reply with quote




Quote:
- Something to do with using a Proxy server? I'm
think probably not. If I close my app and restart, I still get the
same effect after restarting.

yes, it's the proxy server. It doesn't know whether you've
restarted. Read the http spec to see how to ask proxies
not to cache

Grahame

Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Sep 16, 2003 9:23 pm    Post subject: Re: odd behavior with Indy HTTP-- not getting most current t Reply with quote




"Bryan Ray" <bryan (AT) jincsolutions (DOT) com> wrote


Quote:
Possible causes????
- Maybe, I'm retrieving a cached copy of the file?? Is there
some correlation between Indy and Internet Explorer file
history (cached pages/files).

No. Indy does not have anything to do with IE at all, and vice versa.

Quote:
- Something to do with using a Proxy server?

Most likely, yes. Proxies can be configured to cache pages on its end of
the connection.


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03



Back to top
Bryan Ray
Guest





PostPosted: Tue Sep 16, 2003 10:02 pm    Post subject: Re: odd behavior with Indy HTTP-- not getting most current t Reply with quote


Thanks for the response.

Do you know of a way to force the download or bypass the caching feature. Sort of like Internet explorer has the refresh button/feature. Internet Explorer also uses the same proxy, but the refresh option work.

Thanks for any suggestions to get past this.

Bryan


"Remy Lebeau (TeamB)" <gambit47 (AT) yahoo (DOT) com> wrote:
Quote:

"Bryan Ray" <bryan (AT) jincsolutions (DOT) com> wrote in message
news:3f675f98$1 (AT) newsgroups (DOT) borland.com...

Possible causes????
- Maybe, I'm retrieving a cached copy of the file?? Is there
some correlation between Indy and Internet Explorer file
history (cached pages/files).

No. Indy does not have anything to do with IE at all, and vice versa.

- Something to do with using a Proxy server?

Most likely, yes. Proxies can be configured to cache pages on its end of
the connection.


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03




Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Sep 16, 2003 10:15 pm    Post subject: Re: odd behavior with Indy HTTP-- not getting most current t Reply with quote

"Bryan Ray" <bryan (AT) jincsolutions (DOT) com> wrote


Quote:
Do you know of a way to force the download or bypass
the caching feature. Sort of like Internet explorer has the
refresh button/feature. Internet Explorer also uses the same
proxy, but the refresh option work.

Before calling Get(), set the Request->Pragma and/or Request->CacheControl
property to "no-cache", depending on whether you are working with HTTP v1.0
or v1.1.


Gambit



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03



Back to top
Bryan Ray
Guest





PostPosted: Wed Sep 17, 2003 2:14 am    Post subject: Re: odd behavior with Indy HTTP-- not getting most current t Reply with quote

Gambit,

Thanks again for the reply. Do you know where I can get more information on this subject. I would like to read about the various trick like this.

Bryan


"Remy Lebeau (TeamB)" <gambit47 (AT) yahoo (DOT) com> wrote:
Quote:

"Bryan Ray" <bryan (AT) jincsolutions (DOT) com> wrote in message
news:3f67885f$1 (AT) newsgroups (DOT) borland.com...

Do you know of a way to force the download or bypass
the caching feature. Sort of like Internet explorer has the
refresh button/feature. Internet Explorer also uses the same
proxy, but the refresh option work.

Before calling Get(), set the Request->Pragma and/or Request->CacheControl
property to "no-cache", depending on whether you are working with HTTP v1.0
or v1.1.


Gambit



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03




Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed Sep 17, 2003 2:22 am    Post subject: Re: odd behavior with Indy HTTP-- not getting most current t Reply with quote


"Bryan Ray" <bryan (AT) jincsolutions (DOT) com> wrote


Quote:
Do you know where I can get more information on this subject.

Indy's help file as well as the actual RFCs for the portions of the HTTP
protocol which Indy implements, RFC 1945 and RFC 2616.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.