Thanks Rick for the suggestions to:
> On Thu, 25 May 2000, Michael Lake wrote:
> > I have a cgi script which creates a HTML form and I need to
> > do a single forced refresh.
> >
> > 1. script gets called by user submitting form which
> > references a default gif.
> > 2. cgi script runs doing some molecular simulations and
> > creates a gif of the data
> > 3. sends back the same form but with a reference to the new
> > gif
> >
> > Prob is that the browser shows the old gif in the cache.
> > Viewing the new gif in public/tmp/ shows the new one is
> > there.
> >
> > If I set <HEAD refresh='10'> that would refresh every 10
> > seconds but I only want one refresh.
> 

Rick wrote...
> Hmmmm .... HEAD <REFRESH='10'> is a new one!
> Is that available as a W3C standard? Or a vendor specific attribute?
perldoc CGI

> Try this one:
> <META http-equiv="Refresh" content=10; URL=http://blah-balh-blah">
> Hmmm .. why would you want Refresh anyway? If there
> are caching problems, Refresh won't help you :-(

Better that I give a few more details. See below.

> You can send a "pragma: no-cache" in the header of your GIF:
> Content-type: image/gif
> Content-length: 12345
> Pragma: no-cache

I am using gnu plot utils to convert meta data to gifs and
plot does not support that option.
I don't want to contstruct all my own gifs. Plot utils gives
me titles scales etc.
 
> If your GIF is generated by a CGI and can have a dynamic name,
> another way around the caching problem is the following:
>    <img src="/cgi-bin/mygif-generator?a=XXXXXX">

Then they would build up quite quickly. More code to purge
them all every run. But an idea I might think about.


I am doing this:
-------------------------------------------------------------
#!/usr/bin/perl
use CGI qw/:standard/; 

# Declare varables etc...
# Run molecular simulation
# This writes a data file to tmp directory

# This method creates meta data format then converts to a
small gif.
system("graph -L 'Mono-molecular Reaction' -X Time -Y
'Concentration' /tmp/data >| /tmp/temp.meta");
system("plot -T gif /tmp/temp.meta >| /tmp/order1.gif");

my $q = new CGI;                                        #
create new CGI object
print $q->header();                                     #
create the HTTP header
print $q->start_html('Kinetics');       # start the HTML

# HTML formatting output like tables etc things here

print $q->startform("GET","mc");
# More form HTML formatting tables etc
<IMG src="file:///tmp/order1.gif">
print $q->endform;

print $q->end_html; 
--------------------------------------------------------------

This program is then run again with different values for the
reaction and a new gif is generated. The HTML is coming back
to my browser and displaying the *previous* gif image. If I
look at it with xv it shows that /tmp holds the current
newer image but the browser doesn't show it. I can get it to
display by doing a shift-reload. 
Note in Netscape prefences I have 'Doc compared to network'
set to 'Every Time'.

Perhaps I am asking the wrong question? Thi is my 1st CGI
prog.

Mike

--------------------------------------------------------------------
Michael Lake
University of Technology, Sydney
Email: mailto:[EMAIL PROTECTED] Ph: 02 9514 1724 Fx: 02
9514 1628 
URL: http://www.science.uts.edu.au/~mikel
Linux enthusiast, active caver and interested in anything
technical.
--------------------------------------------------------------------
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to