You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by LUKE <lu...@tc.program.com.tw> on 2005/12/18 15:47:02 UTC

The Last-Modified header issue!

The apache v2.055 (mod_perl v2.02) will modify the  Last-Modified's value automatically.

If the OS time is "Sun, 18 Dec 2005 14:25:01 GMT" .
And print out the  Last-Modified header whith 
print "Last-Modified: Sun, 18 Dec 2005 14:28:01 GMT\n";

The apache will modify the value with "Sun, 18 Dec 2005 14:25:01 GMT" automatically.
And the browser will receive the error result. How to override the  Last-Modified's value 
using perl?

====httpd.conf=================================================
Alias /Test/ /usr/local/Test/cgi-bin/
<Location /Test/>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlSendHeader On
Options +ExecCGI
</Location>

Re: The Last-Modified header issue!

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

LUKE wrote:
> The apache v2.055 (mod_perl v2.02) will modify the  Last-Modified's value automatically.
> 
> If the OS time is "Sun, 18 Dec 2005 14:25:01 GMT" .
> And print out the  Last-Modified header whith 
> print "Last-Modified: Sun, 18 Dec 2005 14:28:01 GMT\n";
> 
> The apache will modify the value with "Sun, 18 Dec 2005 14:25:01 GMT" automatically.
> And the browser will receive the error result. How to override the  Last-Modified's value 
> using perl?

try $r->update_mtime and $r->set_last_modified.  a mp1 example can be found here

  http://www.modperlcookbook.org/code/ch06/Cookbook/SendAnyDoc.pm

which ought be able to be ported easily to mp2.

HTH

--Geoff