SPUG: Forcing a browser to refresh a file

Richard Wood wildwood_players at yahoo.com
Tue Jun 20 16:39:12 CDT 2000


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





More information about the spug-list mailing list