Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

bizarre CGI script behaviour

 [1/14] from: g:santilli:tiscalinet:it at: 8-Jan-2001 18:59


Hello Graham! On 07-Gen-01, you wrote: GC>> as soon as it gets a "Pragma: no-cache" in the HTTP GC>> header. GC> I've changed my headers to now say: GC> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> GC> <META HTTP-EQUIV="Expires" CONTENT="0"> GC> <HTML> GC> Hopefully, this will fix the problem till my ISP sorts their GC> side out. <META> tags are interpreted by the browser, but I'm not sure if the proxy would consider them... If it doesn't, try returning it in the headers, like: print "Pragma: no-cache" print "Content-type: text/html" print "" ; ... Regards, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/

 [2/14] from: gchiu::compkarori::co::nz at: 9-Jan-2001 20:44


Hi Gabriele,
> <META> tags are interpreted by the browser, but I'm not > sure if
<<quoted lines omitted: 5>>
> print "" > ; ...
I've gone and bought myself a book on http 1.1 to update myself on these features :-) And my ISP has written back to me to say that they are modifying their proxy servers to stop caching CGI scripts! -- Graham Chiu

 [3/14] from: gchiu:compkarori at: 7-Jan-2001 16:00


This is a strange one. I have a couple of cgi scripts on my remote server that I execute with a cron job from home by basically reading the script viz: read http://myserver.com/cgi-bin/rebolscript.r The cron job only calls the script once, but the script then executes multiple times, at different intervals after that. It executed 10x this morning. How might this be?? ( I am presuming no one else knows the names of these scripts and are not executing them ) I have since put in code into the script that sets a flag so that it can not execute more than once a day, but I would like to know how this has happened. -- Graham Chiu

 [4/14] from: brett:codeconscious at: 7-Jan-2001 14:37


So your computer at home calls the script once a day? And the CGI script was executed multiple times. Can you get at the web logs to ensure there was only one request? No possibility of a webcrawler getting entangled? Brett.

 [5/14] from: gchiu:compkarori at: 7-Jan-2001 17:07


Hi Brett
> So your computer at home calls the script once a day? > And the CGI script was executed multiple times.
Yes. I just put a routine to email each time the script attempts execution, and immediately after I called it via a web browser at about 15:46, it attempted to execute at: 15:46, 15:48, 15:50, 15:52, 15:16, 16:00, 16:04, 16:10, 16:16, 16:24, 16:34 It's now 17:02 so perhaps it has stopped now :-( but it looks like it is executing every 2 minutes, then 4 mins, then 8 mins, then 10 mins
> Can you get at the web logs to ensure there was only one > request?
I think I only get logs once a month. I'll check now.
> No possibility of a webcrawler getting entangled? >
My cgi-bin directory is not browsable, and so I don't think a spider is causing this. The fact that it fires so many times only after I call it once suggests that there is either a problem with the script itself, or possibly the web server - Apache on Solaris. OT: This version of Rebol on Solaris/Sparq doesn't understand 'exists? either. -- Graham Chiu

 [6/14] from: gchiu:compkarori at: 7-Jan-2001 17:47


Hi Brett,
> Can you get at the web logs to ensure there was only one > request?
I've got at the logs and solved the mystery. My Rebol client is only executing the script once, but immediately after this, there are multiple calls to the script coming from my ISP's cache address, a Mozilla client, whereas my script is of course a Rebol client. So, it looks like my ISP's proxy software is causing all the problems :-( I'm gonna complain - this was driving me crazy! -- Graham Chiu

 [7/14] from: brett:codeconscious at: 7-Jan-2001 17:39


Well it is good news in the sense of more information :) I've never done CGI but the questions arise... Why is the cache calling a CGI and can you suggest to it not to? Why is the cache unsatisfied by your script so that it calls it again and again? Is there a "don't cache me" type output header in CGI? If you were doing database inserts with this script it could be a very unhappy situation as it stands. Brett.

 [8/14] from: gchiu:compkarori at: 7-Jan-2001 20:17


On Sun, 7 Jan 2001 17:39:09 +1100 "Brett Handley" <[brett--codeconscious--com]> wrote:
> Well it is good news in the sense of more information :) > > I've never done CGI but the questions arise... > > Why is the cache calling a CGI and can you suggest to it > not to?
I don't know. I have asked my ISP to investigate. However, it does place a cloud over my plans to run multiple CGI scripts on my web server orchestrated by a cron process running at home.
> Why is the cache unsatisfied by your script so that it > calls it again and > again? >
I suspect that their cache server is faulty.
> Is there a "don't cache me" type output header in CGI? >
In http, there is. It tells the browser not to cache the page, and to fetch it from the server. Browsers are supposed to honour this, but whether cache servers do ...
> If you were doing database inserts with this script it > could be a very > unhappy situation as it stands.
It was pretty unhappy as it was - the scripts were emailing a weather and tv report to a list. I was being mail bombed by my own programs :-( After calling it once this afternoon, the ISP's cache program has tried to call it 20x, and is still trying ... -- Graham Chiu

 [9/14] from: g:santilli:tiscalinet:it at: 7-Jan-2001 11:30


Hello Brett! On 07-Gen-01, you wrote: BH> Is there a "don't cache me" type output header in CGI? Pragma: no-cache BH> If you were doing database inserts with this script it could BH> be a very unhappy situation as it stands. Then you'd be passing it arguments and the proxy would notice it should not do it; also, in the case of inserts it is wise to use POST, proxies should never cache a POST method. Regards, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/

 [10/14] from: gchiu:compkarori at: 8-Jan-2001 0:11


Hi Gabriele,
> Then you'd be passing it arguments and the proxy would > notice it > should not do it; also, in the case of inserts it is wise > to use > POST, proxies should never cache a POST method. >
I wondered about this - protecting the script with a password, and ensuring the script would only execute as a result of a post, but wasn't too sure if the proxy would cache my POST, and repeat it. As it is, it's now past midnight, and I am still getting notifications that the proxy is attempting to execute my scripts :-( -- Graham Chiu

 [11/14] from: brett:codeconscious at: 8-Jan-2001 0:04


> As it is, it's now past midnight, and I am still getting > notifications that the proxy is attempting to execute my > scripts :-(
Boy, that is over zealous proxy. I'd like to know the result once you finally resolve the problem. Brett.

 [12/14] from: g:santilli:tiscalinet:it at: 7-Jan-2001 17:59


Hello Brett! On 07-Gen-01, you wrote: BH> Boy, that is over zealous proxy. Maybe the reason is that it thinks it is an html file that is updated very often; so it tries to keep it updated in the cache too, so to lower the chances of cache misses. If this proxy is really that smart (and not just very buggy :), then it should stop as soon as it gets a "Pragma: no-cache" in the HTTP header. Regards, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/

 [13/14] from: gchiu:compkarori at: 8-Jan-2001 7:48


Hi Gabriele,
> as soon as it gets a "Pragma: no-cache" in the HTTP > header. >
I've changed my headers to now say: <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="0"> <HTML> Hopefully, this will fix the problem till my ISP sorts their side out. -- Graham Chiu

 [14/14] from: gchiu:compkarori at: 8-Jan-2001 19:48


> I've changed my headers to now say: > > <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> > <META HTTP-EQUIV="Expires" CONTENT="0"> > <HTML> >
And that seems to have fixed the problem as well. Thanks for the suggestions ... -- Graham Chiu

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted