SPUG: Forcing a browser to refresh a file

Richard Wood wildwood_players at yahoo.com
Wed Jun 21 10:36:49 CDT 2000


Thanks for the ideas, 

I was letting my uncertainty about what headers to
send keep me from just sending the XML file to the
browser in the message.  I fooled with it briefly and
got it working.  All I had to do was

print "Content-type: text/xml\n\n";

in front of the xml and it worked just fine!

Thanks for the help!

FYI, the application sends 500 rows of 6 columns of
data to the browser.  The user can then sort the data
on any column.  If they click on a cell, the row opens
up for update.  If they change data, the changes are
submitted for update and then the data is returned
with the next selected row opened for update.  All of
the sorting and opening of form fields are done with
XSL.  Pretty cool and all client side.

Rich Wood

--- Chris Sutton <chris at smalldognet.com> wrote:
> Question:  Why don't you just send the xml table
> back from the perl
> script instead of redirecting people to the file.  I
> have a feeling the
> header information you are writing is getting
> overridden by whatever the
> webserver is saying about the file.
> 
> Richard Wood wrote:
> > 
> > Hi everyone,
> > 
> > Hopefully I am sending this correctly, it is the
> first
> > question I have sent.
> > 
> > I believe this to be trivial (for someone), but I
> > can't find the answer.
> > 
> > I am building an XML file in a perl script.  I
> then
> > print location and content headers to direct the
> > browser to the xml file.  The problem is, the
> browser
> > is picking up a cached version of the file.  What
> can
> > I do (from the server's perspective) to force the
> > browser to refresh the file?  I suspect it is
> > something in the headers I send, like the date for
> the
> > file.  But I can't get anything to work (yet).
> > 
> > Here are some bits and pieces from the code:
> > 
> > my $redirect_string =
> "http://myhome.com/table.xml";
> > 
> > ($RT,$WT) = (stat("table.xml"))[8,9];
> > $tm = localtime($WT);
> > $hdate = sprintf
> > "%4d%02d%02dT%02d%02d%02dTZD",$tm->year+1900,
> > $tm->mon+1, $tm->mday, $tm->hour, $tm->min,
> $tm->sec;
> > 
> > print ("Location: $redirect_string\n");
> > print ("Date: $htmldate\n");
> > print ("Content-type: text/xml\n\n");
> > 
> > Regards,
> > 
> > Rich Wood
> > 
> > =====
> > Richard O. Wood
> > Wildwood IT Consultants, Inc.
> > wildwood_players at yahoo.com
> > 206.605.2539
> > http://resumes.dice.com/richardowood
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Send instant messages with Yahoo! Messenger.
> > http://im.yahoo.com/
> > 
> >  - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - - - - - - -
> >      POST TO: spug-list at pm.org       PROBLEMS:
> owner-spug-list at pm.org
> >  Seattle Perl Users Group (SPUG) Home Page:
> http://www.halcyon.com/spug/
> >  For Subscriptions, Email to majordomo at pm.org: 
> ACTION  spug-list  EMAIL
> >   Replace ACTION by subscribe or unsubscribe,
> EMAIL by your Email address


=====
Richard O. Wood
Wildwood IT Consultants, Inc.
wildwood_players at yahoo.com
206.605.2539
http://resumes.dice.com/richardowood

__________________________________________________
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 For Subscriptions, Email to majordomo at pm.org:  ACTION  spug-list  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email address





More information about the spug-list mailing list